home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-04-27 | 1.3 MB | 3,103 lines | [ONLN/HLX2] |
Text Truncated. Only the first 1MB is shown below. Download the file for the complete contents.
- Developer NoteQuickTake 100 Digital Camera Apple Computer, Inc.© 1994 Apple Computer, Inc.All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, mechanical, electronic, photocopying, recording, or otherwise, without prior written permission of Apple Computer, Inc.The Apple logo is a trademark of Apple Computer, Inc. Use of the “keyboard” Apple logo (Option-Shift-K) for commercial purposes without the prior written consent of Apple may constitute trademark infringement and unfair competition in violation of federal and state laws.No licenses, express or implied, are granted with respect to any of the technology described in this book. Apple retains all intellectual property rights associated with the technology described in this book. This book is intended to assist application developers to develop applications only for Apple Macintosh computers.Apple Computer, Inc.20525 Mariani AvenueCupertino, CA 95014408-996-1010Apple, the Apple logo, APDA, AppleLink, ColorSync, GeoPort, LaserWriter, Macintosh, QuickDraw, QuickTake, QuickTime, and System 7 are trademarks of Apple Computer, Inc., registered in the United States and other countries.Adobe Illustrator, PostScript are trademarks of Adobe Systems Incorporated, which may be registered in certain jurisdictions.CompuServe is a registered trademark of CompuServe, Inc.America Online is a service mark of Quantum Computer Services, Inc.FrameMaker is a registered trademark of Frame Technology Corporation.Helvetica and Palatino are registered trademarks of Linotype Company.Internet is a trademark of Digital Equipment Corporation.ITC Zapf Dingbats is a registered trademark of International Typeface Corporation.Microsoft Windows is a registered trademark of Microsoft Corporation.NuBus ia a trademark of Texas Instruments.Simultaneously published in the United States and Canada.Even though Apple has reviewed this manual, APPLE MAKES NO WARRANTY OR REPRESENTATION, EITHER EXPRESS OR IMPLIED, WITH RESPECT TO THIS MANUAL, ITS QUALITY, ACCURACY, MERCHANTABILITY, OR FITNESS FOR A PARTICULAR PURPOSE. AS A RESULT, THIS MANUAL IS SOLD “AS IS,” AND YOU, THE PURCHASER, ARE ASSUMING THE ENTIRE RISK AS TO ITS QUALITY AND ACCURACY.IN NO EVENT WILL APPLE BE LIABLE FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES RESULTING FROM ANY DEFECT OR INACCURACY IN THIS MANUAL, even if advised of the possibility of such damages.THE WARRANTY AND REMEDIES SET FORTH ABOVE ARE EXCLUSIVE AND IN LIEU OF ALL OTHERS, ORAL OR WRITTEN, EXPRESS OR IMPLIED. No Apple dealer, agent, or employee is authorized to make any modification, extension, or addition to this warranty.Some states do not allow the exclusion or limitation of implied warranties or liability for incidental or consequential damages, so the above limitation or exclusion may not apply to you. This warranty gives you specific legal rights, and you may also have other rights which vary from state to state.ContentsFigures, Tables, and ListingsviiPreface About This NoteixContents of This NotexSupplementary DocumentsxFor More InformationxiTypographical ConventionsxiiChapter 1 Introduction to the QuickTake 100 Camera1-1QuickTake 100 Overview1-2QuickTake 100 Developer Software1-3Macintosh1-3Windows1-4QuickTake 100 Features1-4User Controls1-4Power On and Off1-4Flash Button1-5Erase-All Button1-6Timer Button1-6Resolution Button1-6Shutter Button1-6LCD Display1-7Battery-Power Icon1-7Pictures-Taken Indicator1-7Pictures-Available Indicator1-7Chapter 2 QuickTake 100 Driver Software2-1QuickTake 100 Device Driver Overview2-2Using the QuickTake 100 Driver Software2-3Initializing the QuickTake 100 Device Driver2-3Establishing a Connection With the Camera2-3Capturing and Retrieving Images2-4Closing the Camera Connection2-4Closing the QuickTake 100 Device Driver2-5Sample Code for Retrieving an Image From the Camera2-5Asynchronous Operations2-7QuickTake 100 Device Driver Reference2-8Data Types for the QuickTake 100 Device Driver Functions2-8QuickTake 100 Device Driver Functions2-19Initializing and Closing the QuickTake 100 Device Driver2-20Connecting With the Camera2-22Controlling the Camera2-28Retrieving and Capturing Images2-54C-Language Summary of the QuickTake 100 Device Driver2-64Constants2-64Data Types2-65Functions 2-68Result Codes2-71Chapter 3 QuickTake 100 Images3-1QuickTake 100 Image Sizes3-2Image Color Depth3-3Chapter 4 Displaying QuickTake 100 Images in a Windows Application4-1Using the Windows IPM4-2IPM Error Handling4-4Image Processing Module Reference4-4Data Types for the Windows IPM Functions4-4IPM Functions for Microsoft Windows Applications4-7C-Language Summary of the Image Processing Module4-21Constants4-21Data Types4-21Functions4-22Result Codes4-24Chapter 5 Displaying QuickTake 100 Images in a Macintosh Application5-1QuickTake 100 QuickTime Decompressor5-2Appendix A QuickTake 100 Serial InterfaceA-1Serial PortA-1Protocol, Transfer Rate, and Data FormatA-2QuickTake 100 Serial Port Pin AssignmentsA-2Serial CablesA-3Appendix B QuickTake 100 Camera SpecificationsB-1Figures, Tables, and ListingsChapter 1 Introduction to the QuickTake 100 Camera1-1Figure 1-1 QuickTake 100 lens cover in the open position1-5Figure 1-2 QuickTake 100 LCD display and user control buttons 1-5Figure 1-3 Rear view of the QuickTake 100 camera1-7Chapter 2 QuickTake 100 Driver Software2-1Table 2-1 CmSetSleep sleepDelay parameter values2-44Table 2-2 QuickTake 100 driver error category codes, mnemonics, and definitions2-49Table 2-3 QuickTake 100 device driver error detail codes, mnemonics, and definitions 2-50Listing 2-1 Using the device driver functions to retrieve an image from the QuickTake 100 camera2-5Chapter 3 QuickTake 100 Images3-1Table 3-1 Memory sizes of supported QuickTake 100 image formats in bytes3-3Table 3-2 Picture display formats and color resolutions3-3Chapter 4 Displaying QuickTake 100 Images in a Windows Application4-1Table 4-1 Memory and image band processing4-4Table 4-2 Default CRT display characteristics4-15Table 4-3 Default CRT display gamma characteristic4-15Appendix A QuickTake 100 Serial InterfaceA-1Figure A-1 QuickTake 100 serial port locationA-1Figure A-2 QuickTake 100 serial port physical patternA-1Figure A-3 QuickTake 100-to-Macintosh serial cableA-3Figure A-4 QuickTake 100-to-Macintosh serial cable pin assignmentsA-3Figure A-5 QuickTake 100-to-Macintosh twisted-pair cable configurationA-4Figure A-6 QuickTake 100 8-pin mini-DIN to RS-232C serial cable and adapterA-4Figure A-7 QuickTake 100 8-pin mini-DIN to D-sub 9-pin RS-232C serial cable pin assignmentsA-5Figure A-8 D-sub 9-pin physical pinout on a QuickTake 100 to D-sub 9-pin serial cableA-5Figure A-9 D-sub 9-pin physical pinout on a D-sub 9-pin to D-sub 25-pin adapter cableA-6Figure A-10 D-sub 25-pin physical pinout on a D-sub 9-pin to D-sub 25-pin adapter cableA-6Table A-1 Serial port pin assignmentsA-2Appendix B QuickTake 100 Camera SpecificationsB-1Table B-1 Venus specificationsB-2About This NoteThis developer note defines the QuickTake 100 software components provided for developers creating applications for either Apple Macintosh computers or computers capable of running Microsoft Windows. The QuickTake 100 software components are in the form of two application programming interfaces (APIs)—a QuickTake 100 camera device driver and an Image Processing Module (IPM). The device driver software provides control services for QuickTake 100 digital computer camera. The camera control software is provided as a device driver and associated glue files for Macintosh computers and as a driver dynamic link library (DLL) for Microsoft Windows. The function names used for the QuickTake 100 driver interface and the QuickTake 100 DLL interface are identical for both the Macintosh and Windows platforms. The APIs for the IPM strictly apply to the Windows platform. QuickTake 100 image processing software decompresses the image data that makes up a QuickTake 100 digital image once that data is present on the host computer. Image processing is performed by a QuickTime decompressor component on the Macintosh computer and by a QuickTake 100 IPM dynamic link library for Microsoft Windows applications. This note assumes that you are already familiar with the hardware and software technology of Macintosh computers and computers capable of running Microsoft Windows software. If you are unfamiliar with Macintosh software and hardware, you may want to obtain copies of the related technical manuals listed in “Supplementary Documents,” later in this preface. While every attempt has been made to verify the accuracy of the information presented, it is subject to change without notice. This developer note may contain information or specifications that are still under consideration by Apple Computer. The primary reason for releasing preliminary product information is to provide the developer community with essential product specifications, theory, and application information for the purpose of stimulating work on compatible third-party products. NoteInformation regarding Windows development software for the QuickTake 100 camera is supplied in this note to give developers an idea of the capabilities of the tools that will soon be available for Windows programmers.uContents of This NoteThis developer note is divided into five chapters and three appendixes:Chapter 1, “Introduction to the QuickTake 100 Camera,” gives a summary of the features of the QuickTake 100 digital computer camera. Chapter 2, “QuickTake 100 Driver Software,” provides an overview of the QuickTake 100 device driver software and presents guidelines and some sample code for using the software to control the QuickTake 100. This chapter also describes the device control functions supported by the QuickTake 100 device driver for Macintosh and Windows-compatible computers.Chapter 3, “QuickTake 100 Images,” provides information about the memory required for displaying the various QuickTake 100 image formats supported by the image processing software. It also lists the bit depths for the output formats. Chapter 4, “Displaying QuickTake 100 Images in a Windows Application,” provides a high-level overview of image processing on a Windows-compatible computer. It also describes the Windows IPM DLL functions that support image processing. These functions are used for gathering information about images in the QuickTake 100 and displaying those images on the host computer. Chapter 5, “Displaying QuickTake 100 Images in a Macintosh Application,” provides an overview of the QuickTime decompressor for image processing on the Apple Macintosh computer. Appendix A, “QuickTake 100 Serial Interface,” includes information about the QuickTake 100 serial connector and supported serial protocols. It also provides two diagrams for building serial cables, one to connect a Macintosh computer to a QuickTake 100 camera and another to connect a Windows-compatible computer to a QuickTake 100. Appendix B, “QuickTake 100 Camera Specifications,” lists the technical specifications for the QuickTake 100 camera.An index is also included. Supplementary DocumentsTo supplement the information in this developer note, Macintosh developers should have copies of the appropriate Apple reference manuals. The following documents are essential to Macintosh software development:Technical Introduction to the Macintosh Family, third edition, surveys the complete Macintosh family of computers from the developer’s point of view. Macintosh Human Interface Guidelines provides authoritative information about the theory behind the Macintosh “look and feel” and standard ways of using individual interface components. Inside Macintosh is a collection of books, organized by topic, that describe the system software of Macintosh computers. Together, these books provide a comprehensive reference for Macintosh programmers, software designers, and engineers. The current volume titles areInside Macintosh: OverviewInside Macintosh: Macintosh Toolbox EssentialsInside Macintosh: More Macintosh ToolboxInside Macintosh: FilesInside Macintosh: ProcessesInside Macintosh: MemoryInside Macintosh: Imaging With QuickDrawInside Macintosh: TextInside Macintosh: Interapplication CommunicationInside Macintosh: QuickTimeInside Macintosh: QuickTime ComponentsInside Macintosh: NetworkingDesigning Cards and Drivers for the Macintosh Family, third edition, explains the hardware and software requirements for drivers and NuBus™ ‘90 accessory cards compatible with Macintosh computers. To supplement the information in this developer note, Windows developers should have copies of the appropriate Microsoft Windows programming reference manuals. Microsoft Press is an excellent source for documentation that meets the needs of the Windows developer. For More InformationAPDA is Apple’s worldwide source for over three hundred development tools, technical resources, training products, and information for anyone interested in developing applications on Apple platforms. Customers receive the quarterly APDA Tools Catalog featuring all current versions of Apple development tools and the most popular third-party development tools. Ordering is easy; there are no membership fees, and application forms are not required for most of the products. APDA offers convenient payment and shipping options, including site licensing.To order products or to request a complimentary copy of the APDA Tools Catalog, contact APDA Apple Computer, Inc. P.O. Box 319Buffalo, NY 14207-0319Telephone 800-282-2732 (United States)800-637-0029 (Canada)716-871-6555 (International) Fax 716-871-6511 AppleLink APDA America Online APDA CompuServe 76666,2405 Internet APDA@applelink.apple.com Typographical ConventionsThis developer note uses typographical conventions that are standard in Apple publications.All code listings and the names of the actual data structures, constants, fields, parameters, and routines are shown in Courier (this is Courier). Hexadecimal numbers are preceded by a dollar sign ($). For example, the hexadecimal equivalent of decimal 16 is written as $10. NoteA note like this contains information that is interesting but not essential for an understanding of the text.u IMPORTANTA note like this contains important information that you should read before proceeding.s Introduction to the QuickTake 100 CameraThis chapter gives a summary of the features of the QuickTake 100 camera. An overview of how to use the features of the QuickTake 100 driver is provided in Chapter 2, “QuickTake 100 Driver Software.” QuickTake 100 OverviewThe QuickTake 100 is a portable, fully automatic, hand-held digital computer camera. It stores compressed 24-bit color still images in internal memory. Images are captured using the same process used to take pictures with any hand-held camera—aim at your subject and press a button to open the shutter and take a picture. The internal memory in the camera acts like a roll of film that stores the images by number. In addition to manual control, the QuickTake 100 can also be controlled over a serial cable by a host computer using the software described in this developer note. The QuickTake 100 provides a simple solution for capturing and transferring digital images to a host computer. Using a serial interface, images captured in the camera can be retrieved by the host computer without the need of an intermediary digitizing device, such as a scanner or frame-capturing video card. The QuickTake 100 serial port is described in Appendix A, “QuickTake 100 Serial Interface.” QuickTake 100 images are captured in two user-defined pixel resolutions—640 by 480 and 320 by 240. Images with 640 by 480 pixels are referred to as high-resolution images. Images with 320 by 240 pixels are referred to as standard-resolution images. The QuickTake 100 camera has a 1 MB memory area for image storage and can store a total of 32 standard-resolution images, 8 high-resolution images, or a combination of the two. In addition, a thumbnail image is stored with each image captured. A thumbnail image has a pixel resolution of 80 by 60. Thumbnail images are useful for previewing the contents of an image file. The images are stored in the camera in a compressed format that cannot be readily used by the host computer. QuickTake 100 images must be retrieved from the camera with the QuickTake 100 driver DLL functions and then decompressed with the Image Processing Module (IPM) functions prior to displaying them within an application window. On the Macintosh computer the IPM functions are incorporated into a QuickTake 100 QuickTime decompressor. Programs written for the Macintosh use the decompressor to decompress the compressed raw QuickTake 100 image data so that the image can be displayed on the Macintosh computer. Standard QuickTime compressor calls are used for the decompression and display process. A Windows DLL provides the IPM for Microsoft Windows. Windows programs use the functions described in Chapter 4, “Displaying QuickTake 100 Images in a Windows Application,” to decompress and display the QuickTake 100 raw image data in an appropriate display format. For a discussion of what your application needs to do to interact with the QuickTake 100 camera, see “Using the QuickTake 100 Driver Software” beginning on page 2-3. QuickTake 100 Developer SoftwareThe QuickTake 100 developer software is available for both Macintosh computers and Microsoft Windows compatible computers. The hardware and software required for developing QuickTake 100 applications on Macintosh and Windows platforms is listed in this section.MacintoshThe QuickTake 100 driver and image processing software work with the following Apple Macintosh computer configurations: n computers with a Motorola 68020 or greater CPUn System 7.0.1• Tune-Up or a later version of system softwaren 5 MB of RAM The QuickTake Image QuickTime decompressor and the QuickTake 100 glue code and header files (CmDriver.c, CmDriver.h, and GeoPortErrors.h) are required to develop software that can recognize and can display QuickTake 100 images that have been saved on the Macintosh computer in the QuickTake 100 image format. In addition to the QuickTake Image QuickTime decompressor system extension, the following software components, which must be installed using the Installer software on the QuickTake 100 disk set, are needed to develop software for connecting to the QuickTake 100 camera, taking pictures, retrieving pictures, and setting various operational paramaters of the camera: n ColorSync version 1.0.3 and ColorSync Profiles—a control panel (provides screen chromaticity values)n Foreign File Access—system extensionn GeoPortSerialDriver 1.0—a system extension (Shared Library Manager module)n Network and associated Network Resources file—control paneln QuickTake Access—system extension (Foreign File Access module)n QuickTake Camera device driver—a system extensionn QuickTime version 1.6.1—a system extensionn Serial Extension—a system extension (Shared Library Manager module)n Serial Switch version 1.1—for the Macintosh IIfx, Macintosh Quadra 900, and Macintosh Quadra 950 computersn Shared Library Manager version 1.1.1 and associated Library Manager Resources fileThe following application software is also on the disks that accompany the QuickTake 100 camera: n QuickTake version 1.0—an application that provides an interface for connecting to the QuickTake 100 camera, taking pictures, retrieving pictures, saving pictures in several file formats, and setting operational paramaters of the cameran QuickTake Setup—a control panel for mounting the camera on the desktopWindowsThe QuickTake 100 driver DLL and image processing DLL software work with the following Microsoft Windows configurations: n Windows 3.1 or latern Intel i80386, i80486, or greater CPU n 4 MB of RAM The following software components are required to create Windows-compatible applications for the QuickTake 100 camera:n QuickTake 100 driver DLL and header file (QTAKE-D.DLL and QTAKE-D.H)n QuickTake 100 IPM DLL and header file (QTAKE-I.DLL and QTAKE-I.H)QuickTake 100 FeaturesThe QuickTake 100 camera has many features that are easily controlled by the user. It also has an LCD display that provides visual feedback about various internal conditions. User ControlsThe QuickTake 100 camera has these user controls: n power on and offn flash buttonn erase-all buttonn timer buttonn resolution buttonn shutter buttonThese controls are described in the following sections.Power On and OffPower is on when the lens cover on the front of the camera is slid to one side, exposing the lens. Figure 1-1 shows the lens cover in the open position. At power-on time, the LCD display, shown in Figure 1-2, becomes active, and the flash is set to automatic. If the green light is on in the view finder, the camera is ready to take a picture. Figure 1-1 QuickTake 100 lens cover in the open positionTo turn the power off, close the lens cover. The picture resolution, number of pictures taken, and number of pictures available settings are stored after the power is turned off. Other settings return to the default values.Figure 1-2 QuickTake 100 LCD display and user control buttons Flash ButtonA flash button toggles three flash settings—automatic flash, flash on, and flash off. Automatic FlashWhen power is on, the flash is set to automatic. When automatic flash is set, the QuickTake 100 camera determines when the flash is used according to the current light conditions. A green light in the view finder indicates the flash is fully powered and the camera is ready to take a picture. Flash OnIf the flash button is pressed while automatic flash is active, the flash-on setting becomes active. In the flash-on setting, the QuickTake 100 camera always uses the flash when a picture is taken. A green light in the view finder indicates the flash is fully powered and the camera is ready to take a picture.Flash OffIf the flash button is pressed while flash on is active, the flash-off setting becomes active. In the flash-off setting, the QuickTake 100 camera does not use the flash. If the flash button is pressed while flash off is active, the automatic-flash setting becomes active. Erase-All ButtonWhen the recessed erase-all button is pressed, all of the images currently stored in the camera are erased. During the period of time that it takes for the images to be erased, the erase-all icon on the LCD display flashes. After the images are erased, the pictures-available indicator displays the number of available pictures for the current resolution setting and the pictures-taken indicator indicates zero pictures have been taken. Timer ButtonThe timer button allows you to initiate a 10-second time delay before a picture is taken. Pressing the shutter button after the timer button is pressed causes a 10-second count to elapse before the shutter is actually opened. An indicator light on the top of the camera is on for 8 seconds and then flashes rapidly for 2 seconds prior to the shutter opening to take the picture. While the camera is in a timer sequence, no other features can be reset. You can’t cancel a timed picture sequence after the shutter button has been pressed by pressing the timer button a second time. Resolution ButtonThe resolution button toggles between high-resolution and standard-resolution picture modes. The maximum number of pictures that can be taken is 8 in high-resolution mode and 32 in standard-resolution mode. (It takes more memory to hold more pixel data, so fewer pictures are available in high-resolution mode.)The resolution setting also affects two indicators on the LCD display—the resolution icon and the pictures-available indicator. The effects that are particular to the display during different resolution settings are described in “LCD Display,” later in this chapter. Shutter ButtonThe shutter button controls when a picture is taken. If the shutter button is pressed and the timer button has not been previously pressed, a picture is taken immediately. If the timer button has been pressed, a 10-second delay occurs prior to a picture being taken. When a picture is taken, the pictures-taken indicator on the LCD display increments by 1. The shutter button is disabled when there are zero pictures available in both high-resolution and standard-resolution picture modes. LCD DisplayThe QuickTake 100 has an LCD display on the back of the camera to the right of the viewfinder, as shown in Figure 1-3. Figure 1-3 Rear view of the QuickTake 100 cameraThe LCD display provides information about the battery-power level, number of pictures taken, number of pictures still available, current picture-resolution mode, current flash setting, timer setting, and an erase-all pictures indicator. Icons or numbers on the display provide a visual representation for each of these conditions. The LCD display is activated when the QuickTake 100 camera is on. Battery-Power IconThe display indicates the current battery-power level with an icon of a battery. The icon indicates three conditions. A battery icon filled with black indicates a fully charged battery. A battery icon with only the right half filled with black indicates that the battery charge has dropped and the battery may need to be charged again soon. The battery icon flashes on and off to indicate that the battery needs to be charged immediately. Pictures-Taken IndicatorThe pictures-taken indicator is in the middle of the display. The count is incremented each time a picture is taken starting from 0 to the number of pictures taken. Pictures-Available IndicatorThe pictures-available indicator displays the number of pictures that remain to be taken in the current picture-resolution mode. This value decrements from 8 in high-resolution mode and decrements from 32 in standard-resolution mode. The pictures-available indicator is located next to the resolution icon on the LCD display. If the resolution button is pressed when the QuickTake 100 camera is in the standard-resolution mode, the resolution mode changes to high resolution and the pictures-available indicator changes to indicate the current number of pictures that are available in high-resolution mode. The number decreases because high-resolution pictures consume larger amounts of image memory than standard-resolution pictures. If the resolution button is pressed while the QuickTake 100 camera is in the high-resolution mode, the resolution mode changes to standard resolution and the pictures-available indicator changes to indicate the total number of pictures available in the standard-resolution mode. The number increases because standard-resolution pictures consume smaller amounts of image memory than high-resolution pictures. If a picture is taken when the picture resolution setting is high resolution and the total number of pictures available indicates one picture, the pictures-available indicator displays 0 for one second. After one second elapses, the resolution setting is changed to standard resolution and the appropriate number of pictures available for standard resolution is indicated. If the resolution button is pressed at this point, the resolution changes back to high resolution and the number of pictures available changes to 0 for one second. After one second elapses, the resolution once again changes to standard and the appropriate number of pictures available in the standard-resolution mode is displayed. QuickTake 100 Driver SoftwareThis chapter presents an architectural overview of the QuickTake 100 driver software, provides basic guidelines for programming applications to control the QuickTake 100 camera and retrieve images stored in the camera memory, describes the driver functions, and includes a sample code listing that shows how you could use the driver functions in a Macintosh application to retrieve an image from the QuickTake 100 camera. QuickTake 100 Device Driver OverviewThe QuickTake 100 device driver includes a library of functions that are designed to facilitate control of the QuickTake 100 camera for taking pictures and retrieving picture images stored in the QuickTake 100 camera. This library of functions effectively hides the device-specific details that are otherwise required to enable an application to perform the tasks. The functions in the library can be categorized as follows:n Driver initialization functions. The functions in this category allocate and deallocate data structures used by the QuickTake 100 device driver.n Camera connection functions. The functions in this category are used to identify and connect to a camera.n Camera control functions. The functions in this group are used to retrieve, set, or control various characteristics of the QuickTake 100 camera, for example, to retrieve information about a particular picture in the camera, to set the flash mode, or to erase the pictures stored in the camera. n Image retrieval and capture functions. The functions in this group are used to retrieve images and take pictures. For the Windows platform, the driver is provided in the form of a dynamic link library (DLL). For the Macintosh platform, the device driver is provided in the form of a QuickTake 100 system extension.All QuickTake 100 driver functions return a result code to notify the caller that the function has successfully completed or to provide a reason if the function is not successful. A result code of 0 (zero) always indicates successful completion. The include file CmDriver.h defines the constants for each error status. Errors also appear in the “Result Codes” section for each function description. If the value returned by a function indicates an error and if the error was detected by the camera, then further information is available through a call to the CmGetErrorInfo function. For information about errors detected by the camera, see the CmGetErrorInfo function described on page 2-48. Using the QuickTake 100 Driver SoftwareTo interact with the QuickTake 100 camera, applications must perform these steps: 1. Open the QuickTake 100 device driver. 2. Establish a connection. 3. Retrieve or capture images. 4. Close the connection. 5. Close the QuickTake 100 device driver.Initializing the QuickTake 100 Device DriverYour application must first initialize the QuickTake 100 device driver by making a call to the CmOpenDriver function. CmOpenDriver allocates and initializes internal structures required by the driver to successfully perform any operations requested by subsequent calls. On the Macintosh platform, CmOpenDriver also initializes and opens the QuickTake 100 driver. The CmOpenDriver function is described on page 2-20. Establishing a Connection With the CameraAfter initializing the QuickTake 100 device driver, your application must identify the camera to be controlled before making a connection to it. This is performed by calling the CmGetPortInfo function to determine whether a camera is attached to the host. If a camera is attached to the host, then call CmConnect to make a connection with that camera. The CmGetPortInfo function returns a CmPortInfo data structure that contains, among other things, information about the current status and availability of a camera attached to the specified serial port. After you determine that a serial port has a camera attached to it and that the camera is available, you then call the CmConnect function with a handle to the CmPortInfo structure for the camera. If more than one camera is attached, you should provide a dialog box that asks the user which camera he or she would like to connect with. The CmConnect function establishes a connection with the camera specified in CmPortInfo. CmConnect and CmPortInfo should be called once for each communication session with a QuickTake 100 camera. See the descriptions of the CmGetPortInfo function on page 2-22, the CmConnect function on page 2-25, and the CmDisconnect function on page 2-27 for additional information about connecting to a QuickTake 100 camera. See the description of CmPortInfo on page 2-10. IMPORTANTIMPORTANTAlthough an application may call CmGetPortInfo successively on as many serial ports as there are available on the host computer, the driver can interact with only one QuickTake 100 camera at a time.sCapturing and Retrieving ImagesAfter the driver is initialized and the connection is made with the QuickTake 100 camera, the application can interact with camera to perform the following tasks: n Get the current status of the camera by calling the CmGetCameraInfo function. The status information returned by this function includes the number of pictures that have been taken, the number of pictures that can be taken, camera battery status, and so on. Refer to the description of the CmGetCameraInfo function on page 2-28. n Get information related to a particular image in the camera by calling the CmGetPictureInfo function. The information returned by this function includes the size, in bytes, of the image corresponding to the picture; the image width and height, in pixels; the date and time the picture was taken; and so on. n Retrieve the image by issuing CmGetThumbnailImage (for the thumbnail version) or CmGetFullSizeImage (for either the standard-resolution or high-resolution version). n Capture an image by calling CmTakePicture, optionally preceded by calls to such functions as CmSetFlashMode, CmSetPictureMode, and possibly CmErase. For more information, see the descriptions of CmGetCameraInfo on page 2-28, CmGetPictureInfo on page 2-29, CmGetThumbnailImage on page 2-54, CmGetFullSizeImage on page 2-57, CmSetFlashMode on page 2-42, CmSetPictureMode on page 2-41, and CmErase on page 2-31. Closing the Camera ConnectionAfter your application has finished interacting with the camera, it must declare its intention to end the session with the camera by calling CmDisconnect and CmDisposePortInfo. Since the CmConnect function establishes an implicit connection with a camera within which the driver functions work, your application must first end any current connection before it is able to establish a connection and interact with other cameras, if any, connected to the host computer. After your application has closed the current camera connection, it may open a new connection with the same camera or other cameras connected to the host as described in “Establishing a Connection With the Camera,” earlier in this chapter. For more information, see the descriptions of CmDisconnect on page 2-27 and CmConnect on page 2-25. Closing the QuickTake 100 Device DriverAfter your application has finished whatever it had to do with the QuickTake 100 device driver and disconnected from any camera with which it was interacting , it must call the function CmCloseDriver. This function frees the internal structures used by the driver. On the Macintosh platform, CmCloseDriver closes the camera driver.For more information, see the description of CmCloseDriver on page 2-21. Sample Code for Retrieving an Image From the CameraListing 2-1, for the Macintosh computer, shows a function called GetImage that uses the QuickTake 100 device driver functions to retrieve an image from the QuickTake 100 camera. Listing 2-1 Using the device driver functions to retrieve an image from the QuickTake 100 camera#include "CmDriver.h"#define kGenericErr -1OSErr GetImage(unsigned short imageNumber, Handle *imageBuffer, unsigned long *imageSize){ OSErr err; CameraData camData; CmPortInfoHandle portInfoHandle; unsigned long portIndex; CmPictureInfo *pictureInfo; Boolean firstRead; unsigned long actualBytes;/* Open the QuickTake 100 camera driver with CmOpenDriver. */ err = CmOpenDriver(&camData); if (err != noErr || camData == NULL) return err;/* Use CmGetPortInfo to find a QuickTake 100 camera on a serial port. */ portIndex = 1; foundCamera = false; while( (err != kNoPortErr) && (!foundCamera) ){ portInfoHandle = NULL; err = CmGetPortInfo(camData, portIndex, &portInfoHandle); if (err != noErr || portInfoHandle == NULL) return err; portIndex++; if ((**portInfoHandle).portStatus == kGeoPortFree) foundCamera = true; else { err = CmDisposePortInfo(camData, portInfoHandle); if (err != noErr) return err; } } if (!foundCamera) return kGenericErr;/* Use CmConnect to connect to the camera that was found with the CmGetPortInfo function.*/ err = CmConnect(camData, portInfoHandle); if (err != noErr) return err;/* Get the image info with the CmGetPictureInfo function and fill in the picture information. */ pictureInfo = (CmPictureInfo *)NewPtr(sizeof(CmPictureInfo)); err = MemError(); if (err != noErr) return err; err = CmGetPictureInfo(camData, imageNumber, pictureInfo); if (err != noErr) return err;/* Allocate the memory for the image. */ *imageSize = pictureInfo->imageDataSize; *imageBuffer = NewHandle(*imageSize); err = MemError(); if (err != noErr) return err;/* Retrieve the image from QuickTake 100 with the CmGetFullSizeImage function. */ MoveHHi(*imageBuffer); HLock(*imageBuffer); firstRead = true; err = CmGetFullSizeImage(camData, imageNumber, (unsigned char *)**imageBuffer, *imageSize, firstRead, &actualBytes); HUnlock(*imageBuffer); if (err != noErr) return err;/* End your connection with the camera. */ err = CmDisconnect(camData); if (err != noErr) return err;/* Dispose of the camera port info structure. */ err = CmDisposePortInfo(camData, portInfoHandle); if (err != noErr) return err;/* Close the driver. */ err = CmCloseDriver(camData); if (err != noErr) return err; return noErr;}Asynchronous OperationsOn the Windows platform, each of the functions CmTakePicture, CmGetThumbnailImage, CmGetFullSizeImage, and CmErase has an asynchronous counterpart whose name is derived by appending the word Async at the end of the function name (for example, CmTakePictureAsync). On the Macintosh platform, the functions CmErase and CmTakePicture have asynchronous counterparts. The goal of the asynchronous set of functions is to allow applications to have a separate thread of execution when performing these functions with the QuickTake 100 camera. The asynchronous functions allow the user to perform other operations, such as typing or editing text, during the time in which a picture is being transferred from the camera to the host computer. The means by which the different threads synchronize their execution is supplied by your application in the form of a completion routine for each of the asynchronous functions. The completion routine CmAsyncCompletionRoutine is shown here: typedef void (CallbackProc)(void);typedef CallballProc* CmAsyncCompletionRoutinePtr;For a complete description of how to use the application-defined completion routine, see the definition on page 2-33. Although the asynchronous functions do provide a means by which an application can receive progress information from an operation asynchronously, neither Windows nor the Macintosh Finder acts as a preemptive multitasking architecture. It is still the responsibility of the application to implement the callback routines within the confines of the respective operating-system environment. NoteThe asynchronous functions CmGetThumbnailImageAsync and CmGetFullSizeImageAsync are not available on the Macintosh platform.u NoteAll of the asynchronous functions CmGetThumbnailImageAsync, CmGetFullSizeImageAsync, CmTakePictureAsync, CmEraseAsync, and CmCancelAsyncOperation are supported by the Windows QuickTake 100 DLL. CmTakePictureAsync and CmEraseAsync are the only asynchronous functions supported on the Macintosh platform.u QuickTake 100 Device Driver ReferenceThe device driver reference defines all of the data types and functions supported by the QuickTake 100 device driver. Data Types for the QuickTake 100 Device Driver FunctionsThis section describes all of the data types referenced by the QuickTake 100 device driver functions. The definitions are found in the CmDriver.h file for Macintosh programs and in the QTAKE-D.H file for Windows programs. CameraDataThe CameraData data type is native to the Macintosh programming environment and defined as typedef CmCameraData* CameraData; For the Windows environment it is defined astypedef unsigned short CameraData; All QuickTake 100 device driver functions require a data item of this type as their first parameter, except CmOpenDriver, which expects the address of a data item of this type. For Windows, the parameter must be the handle of the application program (the variable that Windows gives to your application as the first parameter to WinMain). WinMain and other items specifically referenced by Windows application programs are described in the documentation that accompanies the software programming environment with which Windows applications are created. For the Macintosh computer, this parameter must be the pointer whose address is handed to CmOpenDriver. BufferPtrThe BufferPtr data type is a pointer to an address containing information to be used by a function or an address used to receive information returned by a function. For the Macintosh platform BufferPtr is defined astypedef unsigned char* BufferPtr;For the Windows platform BufferPtr is defined astypedef unsigned char far* BufferPtr;NoteWindows applications should not use the BufferPtr type as it is defined here when making a call to the CmGetFullSizeImage function, described on page 2-57, if the buffer required for the image is greater than 64KB. Instead, use type coercion to change the BufferPtr type of the imageBuffer parameter to unsigned char huge*. u SEE ALSOCmGetThumbnailImage on page 2-54, CmGetThumbnailImageAsync on page 2-56, CmGetFullSizeImage on page 2-57, CmGetFullSizeImageAsync on page 2-60, CmSetOwnerName on page 2-40, and CmGetDecompTable on page 2-45.CmStdFeaturesThe CmStdFeatures structure provides information about the version of the Macintosh QuickTake 100 driver or Windows DLL. typedef struct { short version;} CmStdFeatures, *CmStdFeaturesPtr;Field descriptionsversion Macintosh: The version number of the QuickTake 100 driverWindows: The current version of the DLL SEE ALSOCmGetStdFeatures on page 2-35 CmPortInfoThe CmPortInfo structure contains information about a QuickTake 100 camera that is attached to a host serial port. When you make a call to the CmConnect function to establish a connection with a QuickTake 100 camera, you pass the CmPortInfo structure for the port and camera with which you want to connect. You retrieve the CmPortInfo structure for a specified serial port with the CmGetPortInfo function. typedef struct { Handle portIcon; StringHandle portName; unsigned long portStatus; StringHandle appName; unsigned char familyID; unsigned char deviceID; unsigned short beaconParam; Handle portConfig; unsigned long DataSpeed;} CmPortInfo, *CmPortInfoPtr, **CmPortInforHandle;Field descriptionsField descriptionsportIcon Handle of the icon representing this port. portName Operating-system-specific name of this port. On the Macintosh it is a handle to a length-prefixed Pascal-style string. On the Windows platform it is a null-terminated C string. portStatus The portStatus field contains one of these symbolic constants indicating the status of the port:kGeoPortFree A GeoPort device is attached on this port and is ready to process commands from the host.kPortFree A QuickTake 100 camera is attached on this port and is ready to process commands from the host.kInUseByGeoPort A GeoPort aware application is using the serial port. The family ID, device ID, and beacon parameter will be returned in the familyID, deviceID, and beaconParam fields respectively. kInUseBySerial Another serial application is using the serial port. kInUseByUnknown Another serial application is using the serial port. kInUseByLocalTalk The LocalTalk driver is using the serial port. appName Null. familyID The GeoPort family identification for digital image devices. When a QuickTake 100 camera is attached, this field contains the value 1 and has the constant name kCmFamilyID. deviceID The GeoPort device identification for the camera. When a QuickTake 100 camera is attached, this field contains the value 1 and has the constant name kCmDeviceID.beaconParam The GeoPort beacon parameter of the QuickTake 100 camera. This value is 256.portConfig Operating system dependent. Reserved. DataSpeed The data transfer rate in bits per second of this port. Before an actual camera connection is made, the value of this field is 0. After the connection is made, this field contains the appropriate value for the data transfer rate. See the description of the CmGetPortInfo function on page 2-22 and CmConnect function on page 2-25 for more information about data transfer speed. SEE ALSOCmConnect on page 2-25, CmGetPortInfo page 2-22, CmDisposePortInfo on page 2-24 CmProductInfoThe CmProductInfo structure provides product-specific information about the QuickTake 100 camera. typedef struct { char vendorName[8]; char productIdentification[16]; unsigned char hardwareVersion[2]; unsigned char firmwareVersion[2];} CmProductInfo, *CmProductInfoPtr;Field descriptionsvendorName An 8-byte ASCII string containing the name of the camera vendor. productIdentificationA 16-byte ASCII string containing the product name. hardwareVersion Hardware version of the camera:Byte 0 contains the major version number.Byte 1 contains the minor version number. firmwareVersion Firmware version of the camera:Byte 0 contains the major version number.Byte 1 contains the minor version number. SEE ALSOCmGetProductInfo on page 2-37. CmDateAndTimeThe CmDateAndTime structure contains the current date and time of a specified QuickTake 100 camera. typedef struct { unsigned char month; unsigned char day; unsigned char year; unsigned char hour; unsigned char minute; unsigned char second;} CmDateAndTime, *CmDateAndTimePtr;Field descriptionsmonth Month of the year. Number in the range 1 through 12.day Day of the month. Number in the range 1 through 31.year Last two digits in the year of the century. For example, a value of 93 means the year 1993 (can also mean 2093). Number in the range 0 through 99. hour Hour of the day. Number in the range 0 though 23 (24-hour base; for example, 2:00 P.M. is 14.).minute Minute of the hour. Number in the range 0 through 59.second Second of the minute. Number in the range 0 through 59.SEE ALSOCmSetDateAndTime on page 2-39, CmGetCameraInfo on page 2-28, CmGetPictureInfo on page 2-29 CmInterfaceThe CmInterface structure defines the communication parameters for the QuickTake 100 camera attached to a host running Windows. This structure is one of the fields in the CmCameraInfo structure defined on page 2-14. typedef struct { unsigned char transferRate; unsigned char configuration; unsigned char timeOut;} CmInterface;Field descriptionstransferRate Indicates the data transfer rate between the host and the camera.The transfer rate in bits per second (bps) is calculated by multiplying 1200 by the value of this field. For example, a value of 2 indicates 2400 bps.configuration Indicates the serial communication settings. It contains 8 bits MSB-LSB as follows: parity (2 bits), stop bits (1 bit), data length (2 bits), unused (3 bits). Parity Stop bits Data length00 = None 0 = 1 bit 10 = 7 bits01 = Odd 1 = 2 bits 11 = 8 bits11 = EvenA value of 11011000 would indicate even parity, 1 stop bit, 8 data bits.timeOut Indicates the timeout period beyond which the camera decides that the host timed out. The actual timeout period is ten times the returned value (10 x timeOut) milliseconds. A timeOut value of 0 indicates no timeout. This value is implicitly set to 255, which is approximately 2.5 seconds.CmCameraInfoThe CmCameraInfo structure contains detailed information about the specified QuickTake 100 camera and imaging parameters. typedef struct { unsigned char batteryStatus; unsigned short noPicturesTaken; unsigned short noPictureImageAvailable; unsigned short fullImageWidth; unsigned short fullImageHeight; unsigned short thumbnailImageWidth; unsigned short thumbnailImageHeight; CmDateAndTime cameraDateAndTime; unsigned char flashMode; unsigned short exposureTime; unsigned short FNumber; unsigned char pictureMode; unsigned char reserved unsigned char fullImageDatCompMode; unsigned char thumbImageDatCompMode; unsigned long totalMemorySize; unsigned long freeMemorySize; char ownerName[32]; unsigned char CCDSensorType; CmInterface hostInterface; /* Windows only */ unsigned char cameraInformationBytes[6]; unsigned char compDecompParamVersion[4]; unsigned char colorMatrixVersion[4]; unsigned char spareImageMemoryBlock; unsigned short noBasePicturesTaken; unsigned short noQuarterPicturesTaken; unsigned char sleepDelay;} CmCameraInfo, FarPointer CmCameraInfoPtr;Field descriptionsField descriptionsbatteryStatus Battery charge and battery icon indicator. Five constants are used to specify the current charge condition of the camera batteries and related condition of the battery icon in the LCD display. The constants have the following values:kPowerAdapter = 140 Adapter is connected to the camera.kBatteryRangeFull = 95 Battery is fully charged; the battery icon in the LCD display is full and the adapter is not connected.kBatteryIconFull = 86Values greater than or equal to 86 show a battery icon in the LCD display that is full; the adapter is not connected.kBatteryIconHalf = 80Values between 85 and 80 indicate that the battery is half charged; the battery icon in the LCD display is half full and the adapter is not connected.kBatteryRangeEmpty = 75Battery has an insufficient charge for camera operation; the battery icon in the LCD display is empty and the adapter is not connected.noPicturesTaken Number of pictures that have been taken since camera image memory was last cleared. noPictureImageAvailableNumber of pictures that can be taken. This value is based on the current pictureMode setting of the camera.fullImageWidth Number of pixels in the image width. fullImageHeight Number of pixels in the image height.thumbnailImageWidth Number of pixels in the thumbnail image width.thumbnailImageHeightNumber of pixels in the thumbnail image height.cameraDateAndTime Date and time maintained by the camera. This value can be changed with the CmSetDateAndTime function. See also the CmDateAndTime data structure described on page 2-12.flashMode The flash mode of the camera. 0 = Automatic flash mode1 = Never use flash2 = Always use flashThe flash mode can be modified with the CmSetFlashMode function described on page 2-42.exposureTime Indicates the exposure time that would be required to take a picture at the time of a CmGetCameraInfo function call. The value is the inverse of the actual exposure time. That is, exposure time is (1/exposureTime) seconds.FNumber A function of focal length of the lens of the camera, its diameter, and the shutter speed. 28, 30, 35, 40, 49, 63, 90 and 160 are the possible values for FNumber.pictureMode Specifies the image size of the picture to be taken. 16 = subsequent pictures will be high-resolution.32 = subsequent pictures will be standard-resolution. This value can be changed with the CmSetPictureMode function described on page 2-41.reserved Reserved. fullImageDatCompModeMethod employed to compress image data in the camera. Always 1 adaptive differential pulse code modulation (ADPCM).thumbImageDatCompModeMethod employed to compress thumbnail images. Always 3 (4 bits shifted to the right).totalMemorySize Total size of memory available for picture storage in number of bytes.freeMemorySize Remaining memory available for picture storage in number of bytes.ownerName This field contains the identification of the owner of the camera. It is 32-bytes in length. The maximum number of characters in the owner name is 26, pad to 32 bytes with space characters. The owner name is set with the CmSetOwnerName function described on page page 2-40. CCDSensorType Type of CCD (charged couple device) sensor. 0 = Kodak M7-L1 = Kodak M7hostInterface Serial communication parameters (only valid for Windows). This field is valid only if the underlying communication device is the standard serial interface. The parameter values are contained in the transferRate, configuration, and timeOut fields in the CmInterface structure described on page 2-13.cameraInformationBytesReserved.compDecompParamVersionThe version number of the set of ADPCM compression parameters employed by the camera. colorMatrixVersion The version number of the color correction matrix employed by the camera. Bytes 0 and 1 together are the major version number. Bytes 2 and 3 together are the minor version number. See the description of the CmColorMatrix data structure on page 2-19. Since the color matrix and image compression schemes in the camera may change in the future, it is always important to check the version number of the color matrix. You must make adjustments in your image processing setup, based on the version number of the color matrix in the camera as follows: On the Windows platform, if the color matrix in the camera is version 1, use the default color matrix in the Windows IPM and pass that matrix back to the IPM for image processing. If it is not version 1, pass the color matrix returned by the camera to the IPM. See Chapter 5, “Displaying QuickTake 100 Images in a Macintosh Application” for more information about displaying images on the Windows platform. On the Macintosh platform, if the color matrix is not version 1, get the color matrix from the camera, and fill in the color matrix field for the PICT QuickTake file definition passsed to the QuickTake QuickTime decompressor with the camera color matrix. If the version number is 1, process and display the images with the QuickTake decompressor using the same method you use for QuickTime PICT files. See Chapter 5, “Displaying QuickTake 100 Images in a Macintosh Application” for more information about displaying QuickTake images on the Macintosh computer platform.spareImageMemoryBlockNumber of spare image blocks still available.noBasePicturesTaken Number of high-resolution images that have been taken.noQuarterPicturesTakenNumber of standard-resolution images that have been taken.sleepDelay Sleep delay time of the camera. A numeric value in the range 0 through 5: 0 = Immediate1 = 5 minutes2 = 15 minutes3 = 30 minutes4 = 60 minutes5 = Never sleepSEE ALSOCmGetCameraInfo on page 2-28, CmSetOwnerName on page 2-40, CmSetPictureMode on page 2-41, CmSetFlashMode on page 2-42, CmSetDateAndTime on page 2-39, IpGetCameraColorMatrix on page 4-16, IpSetCameraColorMatrix on page 4-17, IpInitCameraColorMatrix on page 4-17, IpCalculateColorTables on page 4-9 CmPictureInfoThe CmPictureInfo structure provides details about a specified image stored in the internal memory of the QuickTake 100 camera. Images are specified by picture number in the pictureNo parameter of the CmGetPictureInfo function. typedef struct { unsigned short pictureNo; unsigned long imageDataSize; unsigned short width; unsigned short height; CmDateAndTime dateAndTime; unsigned char flashMode; unsigned short exposureTime; unsigned short FNumber; unsigned char pictureMode; unsigned char dataCompressionMode; unsigned char defectiveFlag;} CmPictureInfo, *CmPictureInfoPtr;Field descriptionspictureNo The picture number. This value is the second parameter passed to the CmGetPictureInfo function, which is described on page 2-29. imageDataSize Size of the image in number of bytes. width Width of the image in number of pixels. height Height of the image in number of pixels. dateAndTime Date and time that the image was captured. flashMode A value indicating whether or not the flash was used:0 = Flash not used1 = Flash was usedexposureTime Indicates the exposure time that was required to take the specified picture. Value is (1/exposureTime) seconds. FNumber The focal length of the lens of the camera, the diameter of the lens, and the shutter speed. pictureMode Size of the image:16 = High-resolution image 32 = Standard-resolution image dataCompressionMode Data compression method:1 = ADPCM high- and standard-resolution images3 = Bit shift (4 bits to the right) thumbnail imagesdefectiveFlag Indicates a defect in the image data:1 = One or more bad blocks of data0 = Image is not corruptedSEE ALSOCmGetPictureInfo on page 2-29 CmColorMatrixThe CmColorMatrix data structure is provided for interface to the Image Processing Module to facilitate decoding of the image format employed by the camera. typedef struct { unsigned char colorMatrixVersion[4]; double colorCorrectionMatrix[12];} CmColorMatrix, *CmColorMatrixPtr;Field descriptionscolorMatrixVersion Version number of the color correction matrix returned in the colorCorrectionMatrix parameter. This is the same value that is returned in the colorMatrixVersion field of the CmCameraInfo data structure. colorCorrectionMatrixThe color correction matrix. See the description of the Characteristics structure on page 4-6. SEE ALSOCmGetColorCorrectionMatrix on page 2-46 QuickTake 100 Device Driver FunctionsThis section defines all of the functions supported by the QuickTake 100 device driver. The QuickTake 100 device driver functions provide Macintosh and Windows application developers with a means to control the QuickTake 100 digital camera, gather image information from the camera, and set any user-definable parameters via software. To use the functions, you must include the CmDriver.h file in the include section of your Macintosh application code or the QTAKE-D.H file for Windows application code. The functions are divided into groups:n Driver initialization functions. The functions in this category allocate and deallocate data structures used by the device driver. n Camera connection functions. The functions in this category are used to set up a connection with a camera.n Camera control functions. The functions in this group are used to retrieve or set various characteristics of the QuickTake 100 camera (for example, the owner name).n Image retrieval and capture functions. The functions in this group are used to retrieve images from the camera and take pictures. NoteThe numeric error codes provided in the Result Codes section of each function description are applicable to only Macintosh applications. Where errors apply to both Macintosh and Windows software, the symbolic constants are returned to Windows applications.u Initializing and Closing the QuickTake 100 Device DriverThe functions in this category are CmOpenDriver and CmCloseDriver. These functions allocate and deallocate private data structures required by the QuickTake 100 driver. CmOpenDriverpascal OSErr CmOpenDriver(CameraDataPtr cameraData);cameraData Pointer to the private data allocated and returned by the QuickTake 100 device driver. This pointer must be passed to all the other QuickTake 100 driver functions as the first parameter. For Windows: the address of a memory location that contains the application ID. See “CameraData” on page 2-8 for more information about cameraData.DESCRIPTIONThe CmOpenDriver function initializes the driver by allocating and then initializing certain data structures that the driver uses upon subsequent function calls. NoteDuring initialization on the Macintosh platform, application globals are saved via a call to SetCurrentA5. You can retrieve your application globals by subtracting 4 bytes from the parameter block pointed to in the A0 register. This is especially important for subsequent calls to application-defined completion routines during asynchronous operations. For more information about accessing application globals, see the chapter “Memory Management Utilities” in Inside Macintosh: Memory. For information about the completion routine for asynchronous functions, see the CmAsyncCompletionRoutine function described on page 2-33.u IMPORTANTCalling CmOpenDriver after the driver is open without a prior call to CmCloseDriver will result in an error.s RESULT CODESThe CmOpenDriver function returns noErr on success. If an error occurs, it returns one of the values listed here:kCmAlreadyOpenError -6202 The QuickTake 100 driver is already open. kCmBadArgError -6204 Parameter is or contains an address of an invalid data item. Windows platform only.kCmDriverNotLoadedError -6213 The camera device driver was not loaded at startup time. Macintosh platform only.kCmNoMemoryError -6209 System failed to allocate memory. kCmSystemError Windows DLL failed to either register its class or to create a window. kSoftwareInstallErr -7945 Macintosh GeoPort error: The Shared Library Manager or GeoPort system extensions are missing.memFullErr -108 Macintosh system error: Not enough memory for requested operation. For the Macintosh, kCmAlreadyOpenError is also returned if another application has already opened the QuickTake 100 driver. SEE ALSOCmCloseDriver, described next CmCloseDriverpascal OSErr CmCloseDriver(CameraData cameraData);cameraData The private data structure returned by CmOpenDriver when your application opens the QuickTake 100 device driver. DESCRIPTIONThis function frees the internal structures implicitly referenced by the functions.Your application should call CmCloseDriver once when finished with the QuickTake 100 device driver and after it has disconnected from any camera with which it has been interacting.IMPORTANTCalling CmCloseDriver without a previous call to CmOpenDriver will result in a kCmNotOpenError error. A call to CmCloseDriver made prior to a call to CmDisconnect will not close the connection with the camera. Call CmDisconnect before CmCloseDriver to fully disconnect and close an open session with a camera. s RESULT CODESThe CmCloseDriver function returns noErr upon successful completion. On error, the value returned by this function can be one of the following:kCmAIPError -6201 An asynchronous operation is already in progress. Macintosh platform only.kCmBadArgError -6203 Parameter is or contains an address of an invalid data item.kCmCurrentlyConnectedError -6205 The camera is connected and needs to be disconnected with CmDisconnect before calling CmCloseDriver.kCmNotOpenError -6211 The QuickTake 100 driver has not been initialized.SEE ALSOCmOpenDriver on page 2-20 Connecting With the CameraThe functions CmGetPortInfo, CmDisposePortInfo, CmConnect, and CmDisconnect are used to identify and connect to a camera so that the camera control functions described later in this chapter can be used. CmGetPortInfopascal OSErr CmGetPortInfo(CameraData cameraData, unsigned long index, CmPortInfoHandlePtr portInfoHandle); cameraData The private data structure returned by CmOpenDriver when your application opens the QuickTake 100 device driver. index Index number of a serial port:Macintosh: 1 = Modem port 2 = Printer portWindows: 1 through 9 for Comm 1 through Comm 9, respectivelyportInfoHandleAddress of a memory location into which the handle of a CmPortInfo data structure is to be stored. DESCRIPTIONCmGetPortInfo determines the presence and the availability of a camera at the end of a serial port on the host computer. The driver defines each serial communication port with a number. The number is supplied to this function as the index parameter and is used by CmGetPortInfo to index into the array of serial ports available on the host computer. The output of this function is a handle to the CmPortInfo data structure that contains, among other things, information as to whether the communication port corresponding to the given index number has a camera attached and, if it has, whether the attached camera is available for use by the current application. For information about the CmPortInfo data structure, see page 2-10.The recommended way to use the CmGetPortInfo function is to call it multiple times, incrementing the index parameter by 1 for each call until kCmNoSuchPortError is returned on the Windows platform, or kNoPortErr is returned on the Macintosh platform. Your application code should be prepared to deal with a situation in which it discovers more than one available camera during the calling process. For example, you would provide a dialog box that allows the user to choose the camera with which they would like to make a connection. The handle to the CmPortInfo structure returned by this function is supplied to CmConnect in the portInfoHandle parameter when you want your application to make a connection with the camera. The value contained in the portStatus field of the CmPortInfo structure must be examined before a connection is actually made with the camera. The values in the portStatus field apply to the Windows and Macintosh platforms as follows:The value kPortFree indicates that a camera is attached to the port and no application is currently connected to the camera. You can make a connection to the camera on that port if kPortFree is returned. The value kInUseByGeoPort indicates that a camera is attached to the port, but another application is currently connected to the camera. When you call this function and find a camera that is available and currently not connected, the value in the DataSpeed field of the CmPortInfo structure returned by this function is 0. This is because the actual data transfer rate is not determined until a successful call to CmConnect has been completed. After a successful connection is made, the DataSpeed field in the CmPortInfo structure is updated with the correct data transfer rate. IMPORTANTThis function returns kNoPortErr on the Macintosh platform or kCmNoSuchPortError on the Windows platform if the index parameter is specified as less than 1 or is greater than the number of serial ports available on the host computer. If the index parameter is specified as 0 the system error paramErr (-50) is returned on the Macintosh platform or kCmBadArgError on the Windows platform. It is the responsibility of the application to free the memory area allocated by this function by calling the CmDisposePortInfo function to dispose of the data structure. sRESULT CODESUpon successful completion, CmGetPortInfo returns noErr, and the portInfoHandle parameter supplied to this function contains a valid handle of a CmPortInfo data structure corresponding to the serial port indexed by the index parameter.If an error is detected, the portInfoHandle parameter contains NULL and CmGetPortInfo returns one of the values listed here: kCmAIPError -6201 An asynchronous operation is already in progress. Macintosh platform only.kCmBadArgError -6204 Parameter is or contains an address of an invalid data item.kCmCommError -6214 A serial communication error occurred. Windows platform only.kCmCurrentlyConnectedError -6205 The camera is connected with an application.kCmNoMemoryError -6209 System failed to allocate memory. kCmNoSuchPortError -6210 Corresponding communication port does not exist. Windows platform only.kCmNotOpenError -6211 The driver has not been initialized.kCmProtocolError -6212 Protocol error during communication with the QuickTake 100 camera. Windows platform only.kNoPortErr -7947 GeoPort error: Corresponding communication port does not exist. Macintosh platform only.paramErr -50 Parameter is invalid. Macintosh platform only.SEE ALSOCmDisposePortInfo described next; CmConnect on page 2-25 CmDisposePortInfopascal OSErr CmDisposePortInfo(CameraData cameraData, CmPortInfoHandle portInfoHandle); cameraData The private data structure returned by CmOpenDriver when your application opens the QuickTake 100 device driver. portInfoHandle Handle of the CmPortInfo structure to be freed.DESCRIPTIONThe CmDisposePortInfo function frees the CmPortInfo data structure and associated memory previously allocated by CmGetPortInfo. It is the responsibility of the application to call this function when the CmPortInfo data structure is no longer needed.IMPORTANTApplications must dispose of the CmPortInfo data structure returned by CmGetPortInfo with the CmDisposePortInfo function before making a call to CmCloseDriver. s RESULT CODESUpon successful completion, CmDisposePortInfo returns noErr. If an error is detected, CmDisposePortInfo returns one of the values listed here:kCmAIPError -6201 An asynchronous operation is already in progress. Macintosh platform only.kCmBadArgError -6204 Parameter is or contains an address of an invalid data item.kCmCurrentlyConnectedError -6205 The camera is connected and needs to be disconnected with CmDisconnect before calling CmCloseDriver. Windows platform only. kCmNotOpenError -6211 The driver has not been initialized.SEE ALSOCmGetPortInfo on page 2-22, CmCloseDriver on page 2-21 CmConnect pascal OSErr CmConnect(CameraData cameraData, CmPortInfoHandle portInfoHandle); cameraData The private data structure returned by CmOpenDriver when your application opens the QuickTake 100 device driver. portInfoHandleHandle of a CmPortInfo structure that has been allocated and returned by a previous call to CmGetPortInfo. DESCRIPTIONThe CmConnect function is used to establish a connection with a camera. After a connection is made, the QuickTake 100 device driver functions can be used to control the camera. On the Macintosh computer the connection is a high-speed serial connection. In a Windows environment the CmConnect function determines the fastest speed at which the host and camera can communicate and selects that speed. IMPORTANTIMPORTANTAn application can connect with only one camera at a time. Although an application may allocate more than one CmPortInfo structure by making multiple calls to the CmGetPortInfo function, a kCmCurrentlyConnectedError error will result if that application tries to connect with more than one camera. sNoteIn the Windows software environment CmConnect determines the data transfer speed at which the QuickTake 100 camera and the host communicate. Therefore, the value in the DataSpeed field of portInfoHandle returned by a call to the CmGetPortInfo function is not valid until after a successful call to CmConnect. If communication errors are detected during image data transfers in the Windows environment, the cause may be the transfer speed set at the time the connection with the camera is made. To correct this situation, Windows applications can create an Windows initialization file (INI file) that limits the upper threshold for serial communication with the QuickTake 100 camera. The INI file must be in the Windows root directory and be named QTAKE-D.INI. The file must contain the section [QTake1-D] as follows:[QTake1-D]MaxBaudRate = nnn where nnn is a value that determines the upper threshold for data transfer speed. Allowable values are 9600, 19200, 38400, and 57600. For Windows, the CmConnect function uses 57,600 as the default upper threshold when determining the data transfer speed. If a problem exists during data transfer from the camera, use a lower value for MaxBaudRate in the QTAKE-D.INI file.u RESULT CODESUpon successful completion, CmConnect returns noErr.If an error is detected, this function returns one of the values listed here:kCmAIPError -6201 An asynchronous operation is already in progress. Macintosh platform only.kCmBadArgError -6204 Parameter is or contains an address of an invalid data item.kCmCurrentlyConnectedError -6205 The camera is already connected. kCmCameraNotFoundError -6206 Camera not found on this port. Windows platform only.kCmHandshakeError -6207 Initial handshake with the camera has failed. Windows platform only.kCmNoMemoryError -6209 System failed to allocate memory. Windows platform only.kCmNotOpenError -6211 The QuickTake 100 driver has not been initialized. kCmProtocolError -6212 Protocol error during communication with the camera. Windows platform only.kNoPodErr -7937 Camera not found on this port. Macintosh platform only.This function returns kCmBadArgError if values in the familyID and deviceID fields in the CmPortInfo structure are other than the global constants kCmFamilyID and kCmDeviceID, respectively. This function also returns kCmCameraNotFoundError if the familyID and deviceID fields are not correct. For Windows applications, CmConnect also updates the dataSpeed field of the CmPortInfo structure with the actual data transfer rate that has been set for subsequent communication with the camera. SEE ALSOCmGetPortInfo on page 2-22; CmDisconnect, described next CmDisconnectpascal OSErr CmDisconnect(CameraData cameraData); cameraData The private data structure returned by CmOpenDriver when your application opens the QuickTake 100 device driver. DESCRIPTIONThe CmDisconnect function ends the connection with the camera that was previously established by CmConnect. An application should call CmDisconnect whenever it has finished interacting with a camera. Applications must also call this function before connecting with a camera other than the one with which there is a current connection. After the CmDisconnect function has successfully returned, the application can then make another call to CmConnect to establish a new connection for the camera. The CmDisconnect function terminates any outstanding asynchronous operation with a call to CmCancelAsyncOperation on the Windows platform. On the Macintosh platform, PBKillIO is called to cancel the operation. The callback routine for the canceled asynchronous function will also be called. IMPORTANTAn application should not call CmCloseDriver while a camera connection is active. Call CmDisconnect to end the camera connection and then call CmCloseDriver.s RESULT CODESThis function returns noErr on success. On error, this function returns one of the values listed here:kCmBadArgError -6204 Parameter is or contains an address of an invalid data item.kCmNotConnectedError -6208 A connection with the camera has not been made. kCmNotOpenError -6211 The QuickTake 100 driver has not been initialized.SEE ALSOCmConnect on page 2-25, CmCloseDriver on page 2-21 Controlling the CameraThe functions in this group are used to retrieve or set various characteristics of the QuickTake 100 camera, for example, getting or setting the camera owner name. CmGetCameraInfopascal OSErr CmGetCameraInfo(CameraData cameraData, CmCameraInfoPtr cameraInfo);cameraData The private data structure returned by CmOpenDriver when your application opens the QuickTake 100 device driver. cameraInfoPointer to an area large enough to hold an entire CmCameraInfo structure. DESCRIPTIONThe CmGetCameraInfo function retrieves information related to the QuickTake 100 camera. The information is returned in the form of a CmCameraInfo data structure, described on page 2-14. RESULT CODESUpon successful completion, the CmGetCameraInfo function returns noErr and the area pointed to by the cameraInfo parameter contains the CmCameraInfo data structure corresponding to the currently connected camera. Upon failure, this function returns one of the values listed here. Note that in these error cases the content of the area pointed to by cameraInfo is not affected.kCmAIPError -6201 An asynchronous operation is already in progress. kCmBadArgError -6204 Parameter is or contains an address of an invalid data item. kCmCameraError -6200 Error detected by the camera. Call CmGetErrorInfo.kCmCameraNotFoundError -6206 Device connected to the port is not a QuickTake 100 camera. Macintosh platform only. kCmCommError -6214 A serial communication error occurred. Windows platform only. kCmNoMemoryError -6209 System failed to allocate memory. Windows platform only. kCmNotConnectedError -6208 A connection with the camera has not been made. kCmNotOpenError -6211 The QuickTake 100 driver has not been initialized. kCmProtocolError -6212 Protocol error during communication with QuickTake 100 camera. Windows platform only. NoteApplications must allocate an area of memory large enough to hold the entire CmCameraInfo structure or an error may occur.u SEE ALSOCmGetPictureInfo, described next; CmGetErrorInfo on page 2-48 CmGetPictureInfopascal OSErr CmGetPictureInfo(CameraData cameraData, unsigned short pictureNo, CmPictureInfoPtr pictureInfo); cameraData The private data structure returned by CmOpenDriver when your application opens the QuickTake 100 device driver. pictureNo The number that identifies a particular picture stored in the internal memory of the camera. pictureInfoPointer to an area of memory large enough to hold an entire CmPictureInfo structure.DESCRIPTIONThe CmGetPictureInfo function retrieves information related to a particular picture image stored in the internal memory of the camera. The information is in the form of a CmPictureInfo data structure, which is described on page 2-18. Each image stored within the internal memory of the QuickTake 100 camera has a numeric value associated with it. This number is referred to as the picture number. Essentially, the camera uses numbers to name the images that have been captured. The numbers are assigned in chronological order, with the first picture taken numbered 1, the next picture taken numbered 2, and so on. It is the picture number that is specified in the pictureNo parameter. The picture numbering sequence starts again at the number 1 after a successful call to either the CmErase or the CmEraseAsync function. RESULT CODESUpon successful completion, the CmGetPictureInfo function returns noErr and the area pointed to by the pictureInfo parameter contains the CmPictureInfo structure corresponding to the picture identified by the pictureInfo parameter. If an error is detected, the value returned is one of those listed here. Note that in this case the content of the area pointed to by pictureInfo is unaffected.kCmAIPError -6201 An asynchronous operation is already in progress. kCmBadArgError -6204 Parameter is or contains an address of an invalid data item. kCmCameraError -6200 Error detected by the camera. Call CmGetErrorInfo. kCmCameraNotFoundError -6206 Device connected to the port is not a QuickTake 100 camera. Macintosh platform only. kCmCommError -6214 A serial communication error occurred. Windows platform only. kCmNoMemoryError -6209 System failed to allocate memory. Windows platform only. kCmNotConnectedError -6208 A connection with the camera has not been made. kCmNotOpenError -6211 The QuickTake 100 driver has not been initialized. kCmProtocolError -6212 Protocol error during communication with QuickTake 100 camera. Windows platform only.SEE ALSOCmGetCameraInfo on page 2-28, CmGetThumbnailImage on page 2-54, CmGetFullSizeImage on page 2-57, CmGetErrorInfo on page 2-48 CmErasepascal OSErr CmErase(CameraData cameraData);cameraData The private data structure returned by CmOpenDriver when your application opens the QuickTake 100 device driver. DESCRIPTIONThe CmErase function erases all of the images that have been stored in the internal memory of the camera. After a successful call to CmErase, the picture numbering sequence restarts with the number 1. NoteIf errors are not detected, the CmErase function completes successfully and returns noErr, even if the currently connected camera does not contain any images to erase.u RESULT CODESUpon successful completion, this function returns noErr. If an error is detected, the value returned is one of the following:kCmAIPError -6201 An asynchronous operation is already in progress. kCmBadArgError -6204 Parameter is or contains an address of an invalid data item. kCmCameraError -6200 Error detected by the camera. Call CmGetErrorInfo. kCmCameraNotFoundError -6206 Device connected to the port is not a QuickTake 100 camera. Macintosh platform only. kCmCommError -6214 A serial communication error occurred. Windows platform only. kCmNoMemoryError -6209 System failed to allocate memory. Windows platform only. kCmNotConnectedError -6208 A connection with the camera has not been made. kCmNotOpenError -6211 The QuickTake 100 driver has not been initialized. kCmProtocolError -6212 Protocol error during communication with QuickTake 100 camera. Windows platform only.SEE ALSOCmRestoreDefaults on page 2-38CmEraseAsyncpascal OSErr CmEraseAsync(CameraData cameraData, CmAsyncCompletionRoutinePtr asyncCompletionRoutine);cameraData The private data structure returned by CmOpenDriver when your application opens the QuickTake 100 device driver. asyncCompletionRoutineAddress of a callback routine to call when all the pictures stored in the internal memory of the currently connected camera have been erased. DESCRIPTIONThe CmEraseAsync function is the asynchronous version of the CmErase function and is provided for applications that pursue a different thread of execution during the time the pictures stored in the camera are being erased. When the operation completes, the QuickTake 100 driver calls the CmAsyncCompletionRoutine supplied as the asyncCompletionRoutine parameter to this function (see the description of CmAsyncCompletionRoutine on page 2-33).For Windows applications, the address of the callback routine handed to this function must be the one returned by the Windows function MakeProcInstance.IMPORTANTApplications should not attempt to call any other QuickTake 100 driver control functions including this function before the application-defined callback function CMAsyncCompletionRoutine is called by the QuickTake 100 driver.s Windows applications cannot cancel the CmEraseAsync function by calling CmCancelAsyncOperation. RESULT CODESUpon successful completion, the CmEraseAsync function returns noErr. If an error is detected, the value returned is one of the following:kCmAIPError -6201 An asynchronous operation is already in progress. kCmBadArgError -6204 Parameter is or contains an address of an invalid data item. kCmCantCancel Currently outstanding asynchronous operation cannot be canceled. Windows platform only. kCmNoMemoryError -6209 System failed to allocate memory. Windows platform only. kCmNotConnectedError -6208 A connection with the camera has not been made. kCmNotOpenError -6211 The QuickTake 100 driver has not been initialized.SEE ALSOCmAsyncCompletionRoutine, described next; CmCancelAsyncOperation on page 2-34; CmErase on page 2-31; CmTakePictureAsync on page 2-62; CmRestoreDefaults on page 2-38CmAsyncCompletionRoutinetypedef void (CallbackProc)(void);typedef CallbackProc* CmAsyncCompletionRoutinePtr; DESCRIPTIONThe CmAsyncCompletionRoutine completion routine enables an application to receive notification of the completion of an asynchronous operation. The application provides one or more implementations of the CmAsyncCompletionRoutine function and passes the address of the function as the last parameter to the asynchronous functions CmGetThumbnailImageAsync (Windows platform only), CmGetFullSizeImageAsync (Windows platform only), CmTakePictureAsync, and CmEraseAsync. When any of these asynchronous functions completes its respective operation, the QuickTake 100 driver calls the callback routine. NoteFor Windows applications, the address of the callback routine handed to an asynchronous function must be the one returned by the Windows function MakeProcInstance.uThe method by which the asynchronous call status and bytes transferred (where applicable) are provided to the application differs for the host platforms.For the Windows platform:The gsAsyncStatus global variable contains the value returned by the synchronous version of each of the asynchronous functions. The gulAsyncNBytes global variable is valid only for the functions CmGetThumbnailImageAsync and CmGetFullSizeImageAsync and contains the number of bytes that have actually been transferred to the image buffer allocated for those calls. NoteThe values of the global variables gsAsyncStatus and gulAsyncNBytes are valid only during the time that the CmAsyncCompletionRoutine function is called in response to the completion of an asynchronous operation.uFor the Macintosh platform: A5 globals are saved into a long data type field in the CmCameraData structure when the driver is initially opened. The field is located before the parameter block field, which is also in the data structure. When your completion routine is called, a pointer to the parameter block field can be found at A0 and the result code in D0. You can access the A5 globals by subtracting 4 bytes from the address in A0. RESULT CODESA value of noErr indicates that the asynchronous function completed successfully; otherwise, an error occurred and you should call the CmGetErrorInfo function for additional information. If the asynchronous function was canceled by the user in a Windows application, then the camera returns the camera error and detail code pair kCmErAttention and kCmErCommandAborted when the CMGetErrorInfo function is called. On the Macintosh platform, PBKillIO is called. The kCmdTimeOut GeoPort error and kCmCameraError are returned, but no additional error detail codes are returned to the CmGetErrorInfo function. See the description of the CmGetErrorInfo function on page 2-48 for details about error return values. SEE ALSOCmGetThumbnailImageAsync on page 2-56, CmGetFullSizeImageAsync on page 2-60, CmTakePictureAsync on page 2-62, CmEraseAsync on page 2-32, CmGetErrorInfo on page 2-48, and CmCancelAsyncOperation, described next CmCancelAsyncOperationpascal OSErr CmCancelAsyncOperation (CameraData cameraData);cameraData The private data structure returned by CmOpenDriver when your application opens the QuickTake 100 device driver. DESCRIPTIONThe CmCancelAsyncOperation function provides a method for Windows applications to cancel either a CmGetThumbnailImageAsync function call or a CmGetFullSizeImageAsync function call that is currently outstanding. The callback routine corresponding to the canceled operation is called by the QuickTake 100 driver before this function returns. The global variable gsAsyncStatus that corresponds to the callback routine for the canceled operation will contain the error and detail code pair kCmErAttention and kCmErCommandAborted. See the description of the CmGetErrorInfo function on page 2-48 for details about error return values.This function returns kCmCantCancel if called while either a CmEraseAsync function call or a CmTakePictureAsync function call is outstanding. NoteThis function is available only for the Windows platform.u RESULT CODESThe CmCancelAsyncOperation function returns noErr if the currently outstanding asynchronous operation has successfully been canceled. If an error is detected, the value returned is one of the following:kCmANIPError -6203 No asynchronous operation is outstanding.kCmCantCancel Currently outstanding asynchronous operation cannot be canceled. kCmCommError -6214 A serial communication error occurred.kCmNotConnectedError -6208 A connection with the camera has not been made. kCmNotOpenError -6211 The QuickTake 100 driver has not been initialized.SEE ALSOCmGetThumbnailImageAsync on page 2-56, CmGetFullSizeImageAsync on page 2-60, CmTakePictureAsync on page 2-62, CmEraseAsync on page 2-32, CmAsyncCompletionRoutine on page 2-33 CmGetStdFeaturespascal OSErr CmGetStdFeatures(CameraData cameraData, CmStdFeaturesPtr stdFeaturesPtr, short length);cameraData The private data structure returned by CmOpenDriver when your application opens the QuickTake 100 device driver. stdFeaturesPtrPointer to a memory location to be filled with the standard features of the underlying device driver.length Length of the area pointed to by the stdFeaturesPtr parameter. This is the length in bytes of the amount of information you require from the CmStdFeatures structure, which is described on page 2-10. DESCRIPTIONThe CmGetStdFeatures function retrieves the version number of the underlying QuickTake 100 device driver or Windows DLL. IMPORTANTIf the length parameter is less than the size of the CmStdFeatures data structure, the CmGetStdFeatures function truncates the data that it returns beyond length bytes specified.s NoteThe length parameter exists primarily for a future enhancement to the number of features available to the application.u RESULT CODESUpon successful completion, the CmGetStdFeatures function returns noErr and the area pointed to by the stdFeaturesPtr parameter is filled with the standard features data structure of the underlying device driver. If an error is detected, the value returned is one of the following:kCmAIPError -6201 An asynchronous operation is already in progress. Macintosh platform only. kCmBadArgError -6204 Parameter is or contains an address of an invalid data item. kCmCommError -6214 A serial communication error occurred. Windows platform only. kCmNoMemoryError -6209 System failed to allocate memory. Windows platform only. kCmNotConnectedError -6208 A connection with the camera has not been made. Windows platform only. kCmNotOpenError -6211 The QuickTake 100 driver has not been initialized. SEE ALSOCmGetProductInfo, described next; CmGetErrorInfo on page 2-48 CmGetProductInfopascal OSErr CmGetProductInfo(CameraData cameraData, CmProductInfoPtr productInfo); cameraData The private data structure returned by CmOpenDriver when your application opens the QuickTake 100 device driver. productInfoAddress of a memory area to which this function returns the product information, a CmProductInfo data structure, for the camera currently connected. DESCRIPTIONThe CmGetProductInfo function returns the CmProductInfo data structure related to the currently connected camera. See the description of the CmProductInfo data structure on page 2-12. RESULT CODESUpon successful completion, CmGetProductInfo returns noErr and the area pointed to by productInfo contains the CmProductInfo product information data structure particular to the camera currently connected. See the description of the CmProductInfo data structure on page 2-12. If an error is detected, the value returned is one of the following:kCmAIPError -6201 An asynchronous operation is already in progress. kCmBadArgError -6204 Parameter is or contains an address of an invalid data item. kCmCameraError -6200 Error detected by the camera. Call CmGetErrorInfo.kCmCameraNotFoundError -6206 Device connected to the port is not a QuickTake 100 camera. Macintosh platform only. kCmCommError -6214 A serial communication error occurred. Windows platform only. kCmNoMemoryError -6209 System failed to allocate memory. Windows platform only. kCmNotConnectedError -6208 A connection with the camera has not been made. kCmNotOpenError -6211 The QuickTake 100 driver has not been initialized. kCmProtocolError -6212 Protocol error during communication with QuickTake 100 camera. Windows platform only. SEE ALSOCmGetStdFeatures on page 2-35, CmGetErrorInfo on page 2-48 CmRestoreDefaultspascal OSErr CmRestoreDefaults(CameraData cameraData);cameraData The private data structure returned by CmOpenDriver when your application opens the QuickTake 100 device driver. DESCRIPTIONThe CmRestoreDefaults function resets some of the characteristics of the currently connected camera to their factory settings. The characteristics that are reset to the factory settings are Item Default value Image size High-resolution Image width in pixels 640 Image height in pixels 480 Flash mode Automatic Host interface timeout period 2.55 secondsNoteThe camera name in the ownerName field of the CmCameraInfo data structure is not reverted to the factory setting by this call. uRESULT CODESUpon successful completion, CmRestoreDefaults returns noErr. If an error is detected, the value returned is one of the following:kCmAIPError -6201 An asynchronous operation is already in progress. kCmBadArgError -6204 Parameter is or contains an address of an invalid data item. kCmCameraError -6200 Error detected by the camera. Call CmGetErrorInfo.kCmCameraNotFoundError -6206 Device connected to the port is not a QuickTake 100 camera. Macintosh platform only. kCmCommError -6214 A serial communication error occurred. Windows platform only. kCmNoMemoryError -6209 System failed to allocate memory. Windows platform only. kCmNotConnectedError -6208 A connection with the camera has not been made. kCmNotOpenError -6211 The QuickTake 100 driver has not been initialized. kCmProtocolError -6212 Protocol error during communication with QuickTake 100 camera. Windows platform only. SEE ALSOCmGetStdFeatures on page 2-35, CmGetProductInfo on page 2-37, CmSetOwnerName on page 2-40, CmSetFlashMode on page 2-42, CmSetPictureMode on page 2-41 CmSetDateAndTimepascal OSErr CmSetDateAndTime(CameraData cameraData, CmDateAndTimePtr dateAndTime);cameraData The private data structure returned by CmOpenDriver when your application opens the QuickTake 100 device driver. dateAndTimeAddress of a memory area that contains the date and time to be set for the currently connected camera. DESCRIPTIONThe CmSetDateAndTime function changes the date and time maintained by the camera. RESULT CODESThe CmSetDateAndTime function returns noErr if the operation has been successfully completed. If an error is detected, the value returned is one of the following:kCmAIPError -6201 An asynchronous operation is already in progress. kCmBadArgError -6204 Parameter is or contains an address of an invalid data item. kCmCameraError -6200 Error detected by the camera. Call CmGetErrorInfo.kCmCameraNotFoundError -6206 Device connected to the port is not a QuickTake 100 camera. Macintosh platform only. kCmCommError -6214 A serial communication error occurred. Windows platform only. kCmNoMemoryError -6209 System failed to allocate memory. Windows platform only. kCmNotConnectedError -6208 A connection with the camera has not been made. kCmNotOpenError -6211 The QuickTake 100 driver has not been initialized. kCmProtocolError -6212 Protocol error during communication with QuickTake 100 camera. Windows platform only. SEE ALSOCmSetOwnerName, described next; CmSetPictureMode on page 2-41, CmSetFlashMode on page 2-42 CmSetOwnerNamepascal OSErr CmSetOwnerName(CameraData cameraData, BufferPtr* ownerName); cameraData The private data structure returned by CmOpenDriver when your application opens the QuickTake 100 device driver. ownerNameAddress of a character string (32 bytes) to be stored in the camera. This string is used as the owner name identification for the camera. The name has a maximum length of 26 characters. DESCRIPTIONThe CmSetOwnerName function changes the owner name identification of the currently connected camera. The ownerName parameter points to an array of characters 32 bytes in length. IMPORTANTThe owner name identification must be exactly 32 bytes—no more, no less. To accomodate mounting the QuickTake 100 on the Macintosh descktop, the owner name limit is set at 26 characters. When setting the camera owner name to 26 characters or less, be sure to use space characters to pad the ownerName parameter to 32 bytes.s The current value for the owner name of the camera is contained in the ownerName field of the CmCameraInfo data structure, which is described on page 2-14. The CmCameraInfo data structure can be retrieved via a call to CmGetCameraInfo. The camera owner name remains valid until the application issues another call to CmSetOwnerName.RESULT CODESThe CmSetOwnerName function returns noErr if the identification has successfully been stored. If an error is detected, the value returned is one of the following:kCmAIPError -6201 An asynchronous operation is already in progress. kCmBadArgError -6204 Parameter is or contains an address of an invalid data item. kCmCameraError -6200 Error detected by the camera. Call CmGetErrorInfo.kCmCameraNotFoundError -6206 Device connected to the port is not a QuickTake 100 camera. Macintosh platform only. kCmCommError -6214 A serial communication error occurred. Windows platform only. kCmNoMemoryError -6209 System failed to allocate memory. Windows platform only. kCmNotConnectedError -6208 A connection with the camera has not been made. kCmNotOpenError -6211 The QuickTake 100 driver has not been initialized. kCmProtocolError -6212 Protocol error during communication with QuickTake 100 camera. Windows platform only. SEE ALSOCmGetCameraInfo on page 2-28, CmSetPictureMode, described next; CmSetFlashMode on page 2-42, CmGetErrorInfo on page 2-48 CmSetPictureModepascal OSErr CmSetPictureMode(CameraData cameraData, unsigned char pictureMode);cameraData The private data structure returned by CmOpenDriver when your application opens the QuickTake 100 device driver. pictureModeThe picture mode for the camera. DESCRIPTIONThe CmSetPictureMode function changes the attributes related to the picture mode of the camera currently connected. The picture mode of the camera determines the type of pictures that will be taken by the camera. The possible values for the pictureMode parameter are as follows:kCmCOLOR The subsequent pictures taken shall be stored in full color.kCmCOLORQ The subsequent pictures taken shall be in full color, but the size will be reduced to one-quarter (320 by 240 pixels) of the default full size (640 by 480 pixels). The picture mode attributes are in effect until either the application makes another call to the CmSetPictureMode function to set new values, the application makes a call to CmRestoreDefaults, or the user presses the corresponding resolution button on the camera. NoteThe resolution attributes of images already stored inside the camera prior to a call to CmSetPictureMode are not affected by the function.u RESULT CODESIf the specified mode has successfully been registered in the camera, the CmSetPictureMode function returns noErr. If an error is detected, the value returned is one of the following:kCmAIPError -6201 An asynchronous operation is already in progress. kCmBadArgError -6204 Parameter is or contains an address of an invalid data item. kCmCameraError -6200 Error detected by the camera. Call CmGetErrorInfo.kCmCameraNotFoundError -6206 Device connected to the port is not a QuickTake 100 camera. Macintosh platform only. kCmCommError -6214 A serial communication error occurred. Windows platform only. kCmNoMemoryError -6209 System failed to allocate memory. Windows platform only. kCmNotConnectedError -6208 A connection with the camera has not been made. kCmNotOpenError -6211 The QuickTake 100 driver has not been initialized. kCmProtocolError -6212 Protocol error during communication with QuickTake 100 camera. Windows platform only. SEE ALSOCmRestoreDefaults on page 2-38, CmSetOwnerName on page 2-40, CmGetErrorInfo on page 2-48, CmSetFlashMode, described next CmSetFlashModepascal OSErr CmSetFlashMode(CameraData cameraData, Boolean flashMode); cameraData The private data structure returned by CmOpenDriver when your application opens the QuickTake 100 device driver. flashMode The flash mode to be registered in the camera.DESCRIPTIONThe CmSetFlashMode function registers a new flash mode in the camera currently connected. The flash mode of a camera determines whether the flash is to be on, off, or automatic. The possible values for the flashMode parameter are kCmFlashOn The currently connected camera always uses the flash to take subsequent pictures. kCmFlashOffThe currently connected camera does not use the flash to take subsequent pictures. kCmFlashAutoThe currently connected camera automatically determines how the flash is used to take subsequent pictures. The flash mode setting is in effect until either the application makes another call to the CmSetFlashMode function, the application makes a call to CmRestoreDefaults, or the user presses the corresponding flash button on the camera.RESULT CODESIf the specified flash mode has successfully been registered, the CmSetFlashMode function returns noErr. If an error is detected, the value returned is one of the following:kCmAIPError -6201 An asynchronous operation is already in progress. kCmBadArgError -6204 Parameter is or contains an address of an invalid data item. kCmCameraError -6200 Error detected by the camera. Call CmGetErrorInfo.kCmCameraNotFoundError -6206 Device connected to the port is not a QuickTake 100 camera. Macintosh platform only. kCmCommError -6214 A serial communication error occurred. Windows platform only. kCmNoMemoryError -6209 System failed to allocate memory. Windows platform only. kCmNotConnectedError -6208 A connection with the camera has not been made. kCmNotOpenError -6211 The QuickTake 100 driver has not been initialized. kCmProtocolError -6212 Protocol error during communication with QuickTake 100 camera. Windows platform only. SEE ALSOCmSetOwnerName on page 2-40, CmSetPictureMode on page 2-41, CmRestoreDefaults on page 2-38, CmGetErrorInfo on page 2-48 CmSetSleeppascal OSErr CmSetSleep (CameraData cameraData, short sleepDelay); cameraData The private data structure returned by CmOpenDriver when your application opens the QuickTake 100 device driver. sleepDelay A numeric value that represents the period of time the camera shall remain ready for command processing before entering the sleep state. DESCRIPTIONThe CmSetSleep function sets the time that the camera will remain fully active prior to entering the sleep state. When a QuickTake 100 camera is in the sleep state, the load on the batteries is reduced to help conserve battery life. The default time delay before the camera enters the sleep state is five minutes. The time delay is reset to five minutes after you disconnect from the camera. The sleepDelay parameter is expressed as a number in the range 0 through 5 with the delay values corresponding to those shown in Table 2-1. Table 2-1 CmSetSleep sleepDelay parameter values Value Constant name Description 0 kCmSleepNow Enter the sleep state immediately. 1 kCmSleep5M Enter the sleep state after 5 minutes has elapsed. 2 kCmSleep15M Enter the sleep state after 15 minutes has elapsed. 3 kCmSleep30M Enter the sleep state after 30 minutes has elapsed. 4 kCmSleep60M Enter the sleep state after 60 minutes has elapsed. 5 kCmSleepNever Do not enter the sleep state.The sleep delay time restarts after any command is sent to the camera. NoteOnce the QuickTake 100 camera enters the sleep state, any subsequent commands sent to the camera will return kCmCommError because the serial port connection will have timed out. To reestablish communication with the QuickTake 100 camera, the camera must be manually switched on again. Then your application can call the CmDisconnect function followed by a call to CmConnect to make a connection with the camera.u RESULT CODESThe CmSetSleep function returns noErr if successful. If an error is detected, one of the following values is returned:kCmAIPError -6201 An asynchronous operation is already in progress. kCmBadArgError -6204 Parameter is or contains an address of an invalid data item. kCmCameraError -6200 Error detected by the camera. Call CmGetErrorInfo.kCmCameraNotFoundError -6206 Device connected to the port is not a QuickTake 100 camera. Macintosh platform only. kCmCommError -6214 A serial communication error occurred. Windows platform only. kCmNoMemoryError -6209 System failed to allocate memory. Windows platform only. kCmNotConnectedError -6208 A connection with the camera has not been made. kCmNotOpenError -6211 The QuickTake 100 driver has not been initialized. kCmProtocolError -6212 Protocol error during communication with QuickTake 100 camera. Windows platform only. CmGetDecompTablepascal OSErr CmGetDecompTable (CameraData cameraData, BufferPtr decompTablePtr); cameraData The private data structure returned by CmOpenDriver when your application opens the QuickTake 100 device driver. decompTablePtrPointer to the location in which this function writes the decompression data corresponding to the camera. The decompression information is needed to expand images retrieved from the camera. The size of the memory allocated must be greater than or equal to the size of the structure, which is 98 bytes in length. DESCRIPTIONThe CmGetDecompTable function returns the compression table structure corresponding to the camera currently connected. Windows applications pass this structure to the IPM with the IpSetCompressionTable function. The IPM uses the information in this structure to decompress the image data from the camera before any display of the picture can take place on the host computer. See the functions defined in Chapter 4, “Displaying QuickTake 100 Images in a Windows Application,” for more information about how the compression table data structure returned by this function is used by the IPM. RESULT CODESThe CmGetDecompTable function returns noErr if the data is successfully retrieved and written to the area pointed to by decompTablePtr. If an error is detected, the value returned is one of the following:kCmAIPError -6201 An asynchronous operation is already in progress. kCmBadArgError -6204 Parameter is or contains an address of an invalid data item. kCmCameraError -6200 Error detected by the camera. Call CmGetErrorInfo.kCmCameraNotFoundError -6206 Device connected to the port is not a QuickTake 100 camera. Macintosh platform only. kCmCommError -6214 A serial communication error occurred. Windows platform only. kCmNoMemoryError -6209 System failed to allocate memory. Windows platform only. kCmNotConnectedError -6208 A connection with the camera has not been made. kCmNotOpenError -6211 The QuickTake 100 driver has not been initialized. kCmProtocolError -6212 Protocol error during communication with QuickTake 100 camera. Windows platform only. SEE ALSOCmGetColorCorrectionMatrix, described next; CmGetErrorInfo on page 2-48; and the functions described in Chapter 4, “Displaying QuickTake 100 Images in a Windows Application” CmGetColorCorrectionMatrixpascal OSErr CmGetColorCorrectionMatrix (CameraData cameraData, CmColorMatrixPtr colorMatrix); cameraData The private data structure returned by CmOpenDriver when your application opens the QuickTake 100 device driver. colorMatrixPointer to the location in which this function writes the CmColorMatrix data corresponding to the camera. The size of the memory allocated must be greater than or equal to the size of the CmColorMatrix data structure. DESCRIPTIONThe CmGetColorCorrectionMatrix function returns the CmColorMatrix data structure corresponding to the camera currently connected. Windows applications must pass this data structure to the IPM to accurately reproduce the QuickTake 100 image on the host display. See the functions defined in Chapter 4, “Displaying QuickTake 100 Images in a Windows Application,” for more information about how the data structure returned by this function is used by the IPM. Since the color matrix and image compression schemes in the camera may change in the future, it is always important to check the version number of the color matrix. You must make adjustments in your image processing setup, based on the version number of the color matrix in the camera as follows: On the Windows platform, if the color matrix in the camera is version 1, use the default color matrix in the Windows IPM and pass that matrix back to the IPM for image processing. If it is not version 1, pass the color matrix returned by the camera to the IPM. On the Macintosh platform, if the color matrix is not version 1, get the color matrix from the camera, and fill in the color matrix field for the PICT QuickTake file definition passsed to the QuickTake QuickTime decompressor with the camera color matrix. If the version number is 1, process and display the images with the QuickTake decompressor using the same method you use for QuickTime PICT files. See Chapter 5, “Displaying QuickTake 100 Images in a Macintosh Application” for more information about displaying QuickTake images on the Macintosh computer platform.RESULT CODESThe CmGetColorCorrectionMatrix function returns noErr if the data is successfully retrieved and written to the area pointed to by colorMatrix. If an error is detected, the value returned is one of the following:kCmAIPError -6201 An asynchronous operation is already in progress. kCmBadArgError -6204 Parameter is or contains an address of an invalid data item. kCmCameraError -6200 Error detected by the camera. Call CmGetErrorInfo.kCmCameraNotFoundError -6206 Device connected to the port is not a QuickTake 100 camera. Macintosh platform only. kCmCommError -6214 A serial communication error occurred. Windows platform only. kCmNoMemoryError -6209 System failed to allocate memory. Windows platform only. kCmNotConnectedError -6208 A connection with the camera has not been made. kCmNotOpenError -6211 The QuickTake 100 driver has not been initialized. kCmProtocolError -6212 Protocol error during communication with QuickTake 100 camera. Windows platform only. SEE ALSOCmGetDecompTable on page 2-45; CmGetErrorInfo, described next; and the functions described in Chapter 4, “Displaying QuickTake 100 Images in a Windows Application” CmGetErrorInfopascal OSErr CmGetErrorInfo(CameraData cameraData, shortPtr category, shortPtr detail); cameraData The private data structure returned by CmOpenDriver when your application opens the QuickTake 100 device driver. category Address of a short into which this function returns the category code of a kCmCameraError error. The specifics of the category codes are provided in Table 2-2 on page 2-49.detail Address of a short into which this function returns the detail code of a kCmCameraError error. The specifics of the detail codes are provided in Table 2-3 on page 2-50.DESCRIPTIONThe CmGetErrorInfo function retrieves detailed information about errors returned by the camera. The information returned by CmGetErrorInfo is a pair of short integers in the form category, detail. When a camera error is detected by a call to one of the QuickTake 100 driver functions, the function returns kCmCameraError. To get detailed information about the camera error, call CmGetErrorInfo. For example, a call to the CmGetPictureInfo function with an invalid picture number parameter will cause the function to return a camera error kCmCameraError. To find out what condition caused the camera error, call CmGetErrorInfo, which will return the category and detail code pair kCmErBadPictureNumber and kCmErBadPictNumInfo. The category code returned in the area pointed to by the category parameter provides information about the type of error encountered. The codes and definitions for category are listed in Table 2-2. Codes are hexadecimal values. Table 2-2 QuickTake 100 driver error category codes, mnemonics, and definitions Code Mnemonic Definition 00 kCmErNoError The function completed successfully. 01 kCmErNoBattery Battery low, cannot complete operation. 02 kCmErMemoryFull Image memory is full, cannot take another picture. 03 kCmErFlashNotReady Flash not ready for requested operation. 04 kCmErImageMemoryDefect An error has been detected in the camera image memory. 05 kCmErAttention A recoverable error or camera state change has been detected. See also the description of the kCmErCommandAborted detail error code in Table 2-3. 06 kCmErParityError An error has been detected in the RAM. 07 kCmErTimeoutError A communication error between the camera and host has occurred. 08 kCmErHardwareError An unrecoverable hardware error has occurred. 09 kCmErBadParameter An unrecoverable error caused by invalid values in a function call has occurred. 0A kCmErBadPictureNumber An invalid picture number parameter has occurred. FF kCmErUnknownError Call Apple if you get this category code.As described earlier, each error category has an associated detail code. The detail code returned in the area pointed to by the detail parameter provides specific information about the error that occurred. The codes, mnemonics, and definitions for detail are listed in Table 2-3. Codes are hexadecimal values. Table 2-3 QuickTake 100 device driver error detail codes, mnemonics, and definitions Code Mnemonic Definition 00 kCmErNoError The function completed successfully, no error. 01 kCmErNoBattery Battery low, cannot complete operation. 02 kCmErMemoryFull Image memory is full, cannot take another picture. 03 kCmErFlashNotReady Flash not ready for requested operation. 04 kCmErImageMemoryDefect An error has been detected in the image memory. 06 kCmErParityError A parity error has been detected while processing the last command from the host. 07 kCmErTimeoutError The host timed out. 0B kCmErGeneralHWError An unspecified hardware error has been detected. 0C kCmErCPUError4Bit An error has been detected inside the 4-bit CPU. 0D kCmErCPUError8Bit An error has been detected inside the 8-bit CPU. 0E kCmErDSPError An error has been detected inside the DSP. 0F kCmErFrameMemoryError An error has been detected in the frame memory. 10 kCmErImageMemoryError An image memory error other than the kCmErImageMemoryDefect error has been detected. 11 kCmErInvalidCmdCode The operation code field of the last command block issued by the host contains an invalid value. 12 kCmErInvalidControlCmd The last control command code is unknown. 13 kCmErInvalidCmdData One or more parameters specified in the command descriptor block in the last command from the host contains an invalid value. 14 kCmErInvalidData An invalid value was specified in the additional data following the last command descriptor block. 15 kCmErNoData No additional data to be sent to the host. 16 kCmErBadPicNumImage A picture corresponding to the specified picture number does not exist. 17 kCmErBadPictNumInfo A CmPictureInfo data structure corresponding to the specified picture number does not exist.continuedTable 2-3 QuickTake 100 device driver error detail codes, mnemonics, and definitions (continued) Code Mnemonic Definition 18 kCmErCommandAborted An asynchronous operation has been successfully terminated by the host. If the application cancels an asynchronous operation and if the operation is successfully canceled, the callback routine for that operation returns a status code of CmCameraError. A call to CmGetErrorInfo will then return the category and detail code pair kCmErAttention and kCmErCommandAborted . 19 kCmErTooManyImageMemoryDefectsAn error has been detected in the image memory after all of the spare image memory blocks have been used. NoteCmGetErrorInfo itself may return kCmCameraError.u This function returns noErr when called without your application having detected a kCmCameraError error. In this case, the areas pointed to by category and detail will both contain kCmErNoError.RESULT CODESThe CmGetErrorInfo function returns noErr if error information has successfully been retrieved from the camera currently connected. The areas pointed to by category and detail contain detailed information related to the last error detected. If an error is detected, the value returned is one of the following:kCmAIPError -6201 An asynchronous operation is already in progress. kCmBadArgError -6204 Parameter is or contains an address of an invalid data item. kCmCameraError -6200 Error detected by the camera. Call CmGetErrorInfo.kCmCameraNotFoundError -6206 Device connected to the port is not a QuickTake 100 camera. Macintosh platform only. kCmCommError -6214 A serial communication error occurred. Windows platform only. kCmNoMemoryError -6209 System failed to allocate memory. Windows platform only. kCmNotConnectedError -6208 A connection with the camera has not been made. kCmNotOpenError -6211 The QuickTake 100 driver has not been initialized. kCmProtocolError -6212 Protocol error during communication with QuickTake 100 camera. Windows platform only. SEE ALSOAll QuickTake 100 driver functions CmCheckIfReadypascal OSErr CmCheckIfReady(CameraData cameraData);cameraData The private data structure returned by CmOpenDriver when your application opens the QuickTake 100 device driver. DESCRIPTIONThe CmCheckIfReady function determines whether the camera currently connected is ready for subsequent host command processing. This function provides a simple way to confirm that the currently connected camera is still connected to the host. RESULT CODESCmCheckIfReady returns noErr if the camera is ready to process commands from the host computer. Otherwise, it returns one of the values listed here: kCmAIPError -6201 An asynchronous operation is already in progress. Windows platform only.kCmBadArgError -6204 Parameter is or contains an address of an invalid data item.kCmCameraError -6200 Error detected by the camera. Call CmGetErrorInfo. kCmCameraNotFoundError -6206 Device connected to the port is not a QuickTake 100 camera. Macintosh platform only. kCmCommError -6214 A serial communication error occurred. Windows platform only. kCmNoMemoryError -6209 System failed to allocate memory. Windows platform only. kCmNotConnectedError -6208 A connection with the camera has not been made. kCmNotOpenError -6211 The QuickTake 100 driver has not been initialized.kCmProtocolError -6212 Protocol error during communication with a QuickTake 100 camera. Windows platform only. SEE ALSOCmSelfTest, described next; CmGetErrorInfo on page 2-48CmSelfTestpascal OSErr CmSelfTest(CameraData cameraData); cameraData The private data structure returned by CmOpenDriver when your application opens the QuickTake 100 device driver. DESCRIPTIONThe application calls the CmSelfTest function to trigger the diagnostics test built into the camera currently connected. RESULT CODESThe CmSelfTest function returns noErr if the test has successfully been completed. If the test is not successful, the function returns one of the values listed here:kCmAIPError -6201 An asynchronous operation is already in progress. kCmBadArgError -6204 Parameter is or contains an address of an invalid data item.kCmCameraError -6200 Error detected by the camera. Call CmGetErrorInfo.kCmCameraNotFoundError -6206 Device connected to the port is not a QuickTake 100 camera. Macintosh platform only. kCmCommError -6214 A serial communication error occurred. Windows platform only. kCmNoMemoryError -6209 System failed to allocate memory. Windows platform only.kCmNotConnectedError -6208 A connection with the camera has not been made. kCmNotOpenError -6211 The QuickTake 100 driver has not been initialized. kCmProtocolError -6212 Protocol error during communication with a QuickTake 100 camera. Windows platform only. SEE ALSOCmCheckIfReady on page 2-52, CmGetErrorInfo on page 2-48 Retrieving and Capturing ImagesThe functions in this group are used to retrieve and capture images. CmGetThumbnailImagepascal OSErr CmGetThumbnailImage(CameraData cameraData, unsigned short pictureNo, BufferPtr thumbnailBuffer, unsigned long numberOfBytesToRead, Boolean firstRead, LongPtr actualBytes); cameraData The private data structure returned by CmOpenDriver when your application opens the QuickTake 100 device driver. pictureNo The number identifying the picture whose thumbnail image is to be retrieved.thumbnailBuffer Address of the area to be filled with the data that represent the thumbnail image. numberOfBytesToReadNumber of bytes of data to be read into thumbnailBuffer. This value must be a multiple of 512 unless the entire thumbnail is being transferred in a single call or the last block of data in a multiple-call sequence is read. firstRead If TRUE, uploads the image from the beginning. actualBytesAddress of an area to which this function returns the number of bytes actually read into thumbnailBuffer. DESCRIPTIONThe CmGetThumbnailImage function retrieves the thumbnail version of the image of a particular picture. To make presenting previews of an image in an application easier, the QuickTake 100 camera is capable of sending the host computer a miniaturized version of the image corresponding to a specified picture. This version of the image is called the thumbnail image. The total number of bytes in a thumbnail image is 2400. The numberOfBytesToRead parameter may be less than that. In this case, multiple calls to this function are necessary to get the entire thumbnail image. When making multiple calls to retrieve an image, the application sets firstRead to TRUE the first time the function is called on a particular image, and then sets it to FALSE for the subsequent calls to this function to get the remaining blocks of the image. The area pointed to by the last parameter, actualBytes, contains the number of bytes actually transferred into the buffer pointed to by thumbnailBuffer.NoteNoteIt is the responsibility of the application to allocate the buffer pointed to by thumbnailBuffer. uIf you plan to have your application upload the image in chunks of blocks, then you should not attempt to call any QuickTake 100 driver function (including CmGetThumbnailImage invoked on a different pictureNo parameter) in between successive calls to CmGetThumbnailImage. If you do make other calls on a different picture, it causes the current upload operation to terminate prematurely, and the application will have to restart the upload from the beginning (firstRead = TRUE).The application is expected to know exactly how many times to call this function with the appropriate size buffer (see CmGetPictureInfo). Trying to read image data beyond the actual size of the image will result in an error. The CmGetThumbnailImage function does not return until it has retrieved the specified number of bytes or it has finished. If you want your application to pursue a different thread of execution while retrieving thumbnail data, you should call CmGetThumbnailImageAsync instead of CmGetThumbnailImage.For information about decoding the data format of the image returned by this function, see the CmGetDecompTable function described on page 2-45 and the CmGetColorCorrectionMatrix function described on page 2-46.RESULT CODESUpon successful completion, the CmGetThumbnailImage function returns noErr, and the area pointed to by thumbnailBuffer is filled with the thumbnail image corresponding to the picture identified by the parameter pictureNo. If an error is detected, this function returns one of the values listed here. Note that when an error occurs, the content of the area pointed to by thumbnailBuffer is undefined.kCmAIPError -6201 An asynchronous operation is already in progress. kCmBadArgError -6204 Parameter is or contains an address of an invalid data item. kCmCameraError -6200 Error detected by the camera. Call CmGetErrorInfo. kCmCameraNotFoundError -6206 Device connected to the port is not a QuickTake 100 camera. Macintosh platform only. kCmCommError -6214 A serial communication error occurred. Windows platform only. kCmNoMemoryError -6209 System failed to allocate memory. Windows platform only. kCmNotConnectedError -6208 A connection with the camera has not been made. kCmNotOpenError -6211 The QuickTake 100 driver has not been initialized. kCmProtocolError -6212 Protocol error during communication with QuickTake 100 camera. Windows platform only.SEE ALSOCmGetPictureInfo on page 2-29; CmGetFullSizeImage on page 2-57; CmGetThumbnailImageAsync, described next; CmGetErrorInfo on page 2-48 CmGetThumbnailImageAsyncpascal OSErr CmGetThumbnailImageAsync (CameraData cameraData, unsigned short pictureNo, BufferPtr thumbnailBuffer, unsigned long numberOfBytesToRead, Boolean firstRead, CmAsyncCompletionRoutinePtr asyncCompletionRoutine); cameraData The private data structure returned by CmOpenDriver when your application opens the QuickTake 100 device driver. pictureNo The number identifying the picture whose thumbnail image is to be uploaded.thumbnailBufferAddress of a data area to be filled with the data that represent the thumbnail image.numberOfBytesToReadNumber of bytes of data to be read into thumbnailBuffer. This value must be a multiple of 512 unless the entire thumbnail is being transferred in a single call or the last block of data in a multiple-call sequence is read. firstRead If TRUE, upload starts from the beginning of the image specified.asyncCompletionRoutineAddress of a callback function to be called by the driver when the data transfer is complete.DESCRIPTIONThe CmGetThumbnailImageAsync function is the asynchronous version of CmGetThumbnailImage and is provided for Windows applications that pursue other activities during the time in which a thumbnail image is being retrieved from the camera. The parameters are the same as those supplied to the CmGetThumbnailImage function, except for the last parameter, which is an address of a callback function to be called when the total number of bytes of data specified in numberOfBytesToRead has been transferred to the location pointed to by thumbnailBuffer. (See CmAsyncCompletionRoutine on page 2-33 for information about the callback function.) The address of the callback routine handed to this function must be the one returned by the Windows function MakeProcInstance. IMPORTANTIMPORTANTYour application should not issue a call to any QuickTake 100 driver function (including this function) before completion routine has been called. Likewise, the application should not call any QuickTake 100 driver function other than this function during the time an image is being retrieved. The CmGetThumbnailImageAsync function is valid only for the Windows platform. sRESULT CODESUpon successful completion, the CmGetThumbnailImageAsync function returns noErr. If an error is detected, this function returns one of the values listed here:kCmAIPError -6201 An asynchronous operation is already in progress.kCmBadArgError -6204 Parameter is or contains an address of an invalid data item.kCmNoMemoryError -6209 System failed to allocate memory. kCmNotConnectedError -6208 A connection with the camera has not been made. kCmNotOpenError -6211 The QuickTake 100 driver has not been initialized. SEE ALSOCmAsyncCompletionRoutine on page 2-33, CmCancelAsyncOperation on page 2-34, CmGetThumbnailImage on page 2-54, CmGetFullSizeImageAsync on page 2-60, CmGetDecompTable on page 2-45, CmGetColorCorrectionMatrix on page 2-46, CmGetErrorInfo on page 2-48 CmGetFullSizeImagepascal OSErr CmGetFullSizeImage(CameraData cameraData, unsigned short pictureNo, BufferPtr imageBuffer, unsigned long numberOfBytesToRead, Boolean firstRead, LongPtr actualBytes); cameraData The private data structure returned by CmOpenDriver when your application opens the QuickTake 100 device driver. pictureNo The number identifying the picture whose full-size image is to be uploaded. imageBufferAddress of the buffer into which data corresponding to the image is to be stored.numberOfBytesToReadThe number of bytes of data to be transferred to imageBuffer. This value must be a multiple of 512 unless the entire image is being transferred in a single call or when the last block of data in a multiple-call sequence is read. firstRead If TRUE, data is transferred beginning from the start of the image.actualBytesAddress of a memory location into which this function writes the number of bytes actually transferred into imageBuffer.NoteWindows applications should not use the BufferPtr type for the imageBuffer parameter as it is defined on page 2-9 when making a call to the CmGetFullSizeImage function, if the number of bytes to read into the buffer required for the image is greater than 64,000 (high-resolution images require 115,200 bytes). Instead, use type coercion to change the type of the imageBuffer parameter to unsigned char huge*.u DESCRIPTIONThe CmGetFullSizeImage function retrieves the full-size image of the picture in the camera. Your application may allocate enough memory to hold the entire amount of data comprising the image to be retrieved. In this case, set numberOfBytesToRead to the actual number of bytes of the image (see CmGetPictureInfo). The entire data retrieval process finishes with a single call to the function.However, if host memory is in short supply, numberOfBytesToRead may be set to less than the actual number of bytes comprising the image. In this case, multiple calls to this function are necessary to upload all of the image data.To make multiple calls to CmGetFullSizeImage, set firstRead to TRUE in the first call to the function on a particular image, and then set firstRead to FALSE for the subsequent calls to get the remaining blocks of the image. The area pointed to by the last parameter, actualBytes, contains the number of bytes actually transferred into the buffer pointed to by imageBuffer.For information about decoding the data format of the image returned by this function, see the CmGetDecompTable function described on page 2-45, the CmGetColorCorrectionMatrix function described on page 2-46, the IpGetCompressionTable function described on page 4-18, the IpSetCompressionTable function described on page 4-19, and the IpInitCompressionTable function described on page 4-9.It is the responsibility of your application to allocate the buffer pointed to by imageBuffer.NoteIf your application uploads the image in chunks of blocks, it should not attempt to call any QuickTake 100 driver function (including this function on a different picture) in between successive calls to CmGetFullSizeImage. Any attempt at calling another function causes the current retrieval operation to end prematurely and makes it necessary to restart the process from the beginning (firstRead = TRUE). The application is expected to know exactly how many times it must call CmGetFullSizeImage and with how large a buffer. Attempting to read image data beyond the actual size of the data results in an error. The CmGetFullSizeImage function does not return to the application until it has retrieved the specified number of bytes or it has finished. uIf you want your application to pursue a different thread of execution during the retrieval process, call CmGetFullSizeImageAsync instead of CmGetFullSizeImage.RESULT CODESUpon successful completion, the CmGetFullSizeImage function returns noErr and the area pointed to by imageBuffer is filled with the image corresponding to the picture identified by the second parameter, pictureNo. If an error is detected, CmGetFullSizeImage returns one of the values listed here. Note that when an error occurs, the content of the area pointed to by the imageBuffer parameter is undefined.kCmAIPError -6201 An asynchronous operation is already in progress. kCmBadArgError -6204 Parameter is or contains an address of an invalid data item. kCmCameraError -6200 Error detected by the camera. Call CmGetErrorInfo. kCmCameraNotFoundError -6206 Device connected to the port is not a QuickTake 100 camera. Macintosh platform only. kCmCommError -6214 A serial communication error occurred. Windows platform only. kCmNoMemoryError -6209 System failed to allocate memory. Windows platform only. kCmNotConnectedError -6208 A connection with the camera has not been made. kCmNotOpenError -6211 The QuickTake 100 driver has not been initialized. kCmProtocolError -6212 Protocol error during communication with QuickTake 100 camera. Windows platform only.SEE ALSOCmGetCameraInfo on page 2-28; CmGetPictureInfo on page 2-29; CmGetThumbnailImage on page 2-54; CmGetFullSizeImageAsync described next; CmGetDecompTable on page 2-45; CmGetColorCorrectionMatrix on page 2-46; CmGetErrorInfo on page 2-48 CmGetFullSizeImageAsyncpascal OSErr CmGetFullSizeImageAsync(CameraData cameraData, unsigned short pictureNo, BufferPtr imageBuffer, unsigned long numberOfBytesToRead, Boolean firstRead, CmAsyncCompletionRoutinePtr asyncCompletionRoutine); cameraData The private data structure returned by CmOpenDriver when your application opens the QuickTake 100 device driver. pictureNo The number identifying the picture whose full-size image is to be uploaded. imageBufferAddress of the buffer into which data corresponding to the image is to be stored.numberOfBytesToReadThe number of bytes of data to be transferred to imageBuffer. This value must be a multiple of 512 unless the entire image is being transferred in a single call or when the last block of data in a multiple-call sequence is read. firstRead If TRUE, data is transferred beginning from the start of the image.asyncCompletionRoutineAddress of a callback function to be called when the specified number of bytes has been transferred to the buffer pointed to by imageBuffer.DESCRIPTIONThe CmGetFullSizeImageAsync function is the asynchronous version of CmGetFullSizeImage and is provided for Windows applications that pursue a different thread of execution during the time the image retrieval process is taking place.The parameters are the same as those supplied to the CmGetFullSizeImage function except for the last parameter, asyncCompletionRoutine, which is the address of a callback routine to be called after the specified number of bytes have been transferred to the memory location pointed to by imageBuffer. (See CmAsyncCompletionRoutine on page 2-33.) For Windows applications, the address of the callback routine handed to this function must be the one returned by the Windows function MakeProcInstance.IMPORTANTYour application should not attempt to call any of the QuickTake 100 driver functions (including this function) prior to the time that the QuickTake 100 driver calls your callback routine.Likewise, you should not attempt to issue calls to any of the QuickTake 100 driver functions (except this function) while the image retrieval process is taking place. sThe CmGetFullSizeImageAsync function is valid only for the Windows platform.RESULT CODESUpon successful completion, the CmGetFullSizeImageAsync function returns noErr. If an error is detected, the value returned by this function is one of the following:kCmAIPError -6201 An asynchronous operation is already in progress.kCmBadArgError -6204 Parameter is or contains an address of an invalid data item.kCmNoMemoryError -6209 System failed to allocate memory. kCmNotConnectedError -6208 A connection with the camera has not been made. kCmNotOpenError -6211 The QuickTake 100 driver has not been initialized. SEE ALSOCmAsyncCompletionRoutine on page 2-33, CmCancelAsyncOperation on page 2-34, CmGetFullSizeImage on page 2-57, CmGetThumbnailImageAsync on page 2-56, CmGetErrorInfo on page 2-48 CmTakePicturepascal OSErr CmTakePicture(CameraData cameraData, Boolean timerOn);cameraData The private data structure returned by CmOpenDriver when your application opens the QuickTake 100 device driver. timerOn If TRUE, the camera will take a picture at the expiration of its internal timer. If FALSE, the picture is taken immediately. DESCRIPTIONThe CmTakePicture function causes the camera currently connected to take a picture.Setting timerOn to FALSE causes the next picture to be taken immediately. Setting it to TRUE causes the camera to take the picture at the expiration of its internal timer. IMPORTANTThe number of pictures that can be taken by the camera must at least be 1 in order for the CmTakePicture function to succeed.CmTakePicture does not return to the application until the camera has finished attempting to take a picture. Care should be taken to ensure that the function has completed the picture-taking operation when timerOn is specified as TRUE. sRESULT CODESIf a picture has successfully been taken, the CmTakePicture function returns noErr. If an error is detected, this function returns one of the following values:kCmAIPError -6201 An asynchronous operation is already in progress. kCmBadArgError -6204 Parameter is or contains an address of an invalid data item. kCmCameraError -6200 Error detected by the camera. Call CmGetErrorInfo. kCmCameraNotFoundError -6206 Device connected to the port is not a QuickTake 100 camera. Macintosh platform only. kCmCommError -6214 A serial communication error occurred. Windows platform only. kCmNoMemoryError -6209 System failed to allocate memory. Windows platform only. kCmNotConnectedError -6208 A connection with the camera has not been made. kCmNotOpenError -6211 The QuickTake 100 driver has not been initialized. kCmProtocolError -6212 Protocol error during communication with QuickTake 100 camera. Windows platform only.SEE ALSOCmGetCameraInfo on page 2-28; CmTakePictureAsync, described next; CmErase on page 2-31; CmGetErrorInfo on page 2-48CmTakePictureAsyncpascal OSErr CmTakePictureAsync(CameraData cameraData, Boolean timerOn, CmAsyncCompletionRoutinePtr asyncCompletionRoutine); cameraData The private data structure returned by CmOpenDriver when your application opens the QuickTake 100 device driver. timerOn If TRUE, the camera will take a picture at the expiration of its internal timer. If FALSE, the picture is taken immediately. asyncCompletionRoutineAddress of a callback routine to be called after a picture has been taken.DESCRIPTIONThe CmTakePictureAsync function is the asynchronous version of CmTakePicture and is provided for applications that pursue a different thread of execution during the time a picture is being taken by the camera currently connected. For Windows applications, the address of the callback routine handed to this function must be the one returned by the Windows function MakeProcInstance.IMPORTANTYour application should not attempt to call any of the QuickTake 100 driver functions including this function before the corresponding callback routine has been invoked. Care should be taken to ensure that the function has completed its picture taking operation when timerOn is specified as TRUE.Windows applications cannot cancel this function by calling CmCancelAsyncOperation.s RESULT CODESThe CmTakePictureAsync function returns noErr if the request is successful. If an error is detected, this function returns one of the following error values:kCmAIPError -6201 An asynchronous operation is already in progress. kCmBadArgError -6204 Parameter is or contains an address of an invalid data item. kCmCantCancel Currently outstanding asynchronous operation cannot be canceled. Windows platform only.kCmNoMemoryError -6209 System failed to allocate memory. Windows platform only. kCmNotConnectedError -6208 A connection with the camera has not been made. kCmNotOpenError -6211 The QuickTake 100 driver has not been initialized. SEE ALSOCmAsyncCompletionRoutine on page 2-33, CmCancelAsyncOperation on page 2-34, CmTakePicture on page 2-61, CmEraseAsync on page 2-32, CmGetErrorInfo on page 2-48 C-Language Summary of the QuickTake 100 Device DriverConstants/* CmSetPictureMode picture modes */kCmColor 0x10kCmColorQ 0x20/* CmSetFlashMode flash modes */kCmFlashOn 0x02kCmFlashOff 0x01kCmFlashAuto 0x00/* CmSetOwnerName owner name string length */kCmMAXIDWIDTH 32/* decompression table size */kCmDecompTableSize 98/* sleep modes */kCmSleepNow 0kCmSleep5M 1kCmSleep15M 2kCmSleep30M 3kCmSleep60M 4kCmSleepNever 5/* battery status indicators */kPowerAdapter 140 /* Power adapter is connected */kBatteryRangeFull 95 /* Battery is fully charged */kBatteryIconFull 86 /* Values >= 86 indicates the battery icon shows full charge */kBatteryIconHalf 80 /* Values 80 through 85 indicate that the battery icon shows half charge */kBatteryRangeEmpty 75 /* Battery has an insufficient charge, battery icon shows empty*/Data TypesCameraDataFor the Macintosh platform CameraData is defined as typedef CmCameraData* CameraData; For the Windows platform CameraData is defined astypedef unsigned short CameraData; BufferPtrFor the Macintosh platform BufferPtr is defined as typedef unsigned char* BufferPtr;For the Windows platform BufferPtr is defined astypedef unsigned char far* BufferPtr;CmStdFeaturestypedef struct { short version;} CmStdFeatures, *CmStdFeaturesPtr;CmPortInfotypedef struct { Handle portIcon; StringHandle portName; unsigned long portStatus; StringHandle appName; unsigned char familyID; unsigned char deviceID; unsigned short beaconParam; Handle portConfig; unsigned long DataSpeed;} CmPortInfo, *CmPortInfoPtr, **CmPortInforHandle;CmProductInfotypedef struct { char vendorName[8]; char productIdentification[16]; unsigned char hardwareVersion[2]; unsigned char firmwareVersion[2];} CmProductInfo, *CmProductInfoPtr;CmDateAndTimetypedef struct { unsigned char month; unsigned char day; unsigned char year; unsigned char hour; unsigned char minute; unsigned char second;} CmDateAndTime, *CmDateAndTimePtr;CmInterfacetypedef struct { unsigned char transferRate; unsigned char configuration; unsigned char timeOut;} CmInterface;CmCameraInfotypedef struct { unsigned char batteryStatus; unsigned short noPicturesTaken; unsigned short noPictureImageAvailable; unsigned short fullImageWidth; unsigned short fullImageHeight; unsigned short thumbnailImageWidth; unsigned short thumbnailImageHeight; CmDateAndTime cameraDateAndTime; unsigned char flashMode; unsigned short exposureTime; unsigned short FNumber; unsigned char pictureMode; unsigned char reserved; unsigned char fullImageDatCompMode; unsigned char thumbImageDatCompMode; unsigned long totalMemorySize; unsigned long freeMemorySize; char ownerName[32]; unsigned char CCDSensorType; CmInterface hostInterface; unsigned char cameraInformationBytes[6]; unsigned char compDecompParamVersion[4]; unsigned char colorMatrixVersion[4]; unsigned char spareImageMemoryBlock; unsigned short noBasePicturesTaken; unsigned short noQuarterPicturesTaken; unsigned char sleepDelay;} CmCameraInfo, FarPointer CmCameraInfoPtr;CmPictureInfotypedef struct { unsigned short pictureNo; unsigned long imageDataSize; unsigned short width; unsigned short height; CmDateAndTime dateAndTime; unsigned char flashMode; unsigned short exposureTime; unsigned short FNumber; unsigned char pictureMode; unsigned char dataCompressionMode; unsigned char defectiveFlag;} CmPictureInfo, *CmPictureInfoPtr;CmColorMatrixtypedef struct { unsigned char colorMatrixVersion[4]; double colorCorrectionMatrix[12];} CmColorMatrix, *CmColorMatrixPtr;Functions Opening and Closing the QuickTake 100 Device Driverpascal OSErr CmOpenDriver (CameraDataPtr cameraData);pascal OSErr CmCloseDriver (CameraData cameraData);Connecting With the Camerapascal OSErr CmGetPortInfo (CameraData cameraData, unsigned long index, CmPortInfoHandlePtr portInfoHandle);pascal OSErr CmDisposePortInfo (CameraData cameraData, CmPortInfoHandle portInfoHandle);pascal OSErr CmConnect (CameraData cameraData, CmPortInfoHandle portInfoHandle);pascal OSErr CmDisconnect (CameraData cameraData);Controlling the Camerapascal OSErr CmGetCameraInfo (CameraData cameraData, CmCameraInfoPtr cameraInfo);pascal OSErr CmGetPictureInfo (CameraData cameraData, unsigned short pictureNo, CmPictureInfoPtr pictureInfo);pascal OSErr CmErase (CameraData cameraData);pascal OSErr CmEraseAsync (CameraData cameraData, CmAsyncCompletionRoutinePtr asyncCompletionRoutine);typedef void (CallbackProc)(void);typedef CallbackProc* CmAsyncCompletionRoutinePtr;pascal OSErr CmCancelAsyncOperation (CameraData cameraData);pascal OSErr CmGetStdFeatures (CameraData cameraData, CmStdFeaturesPtr stdFeaturesPtr, short length);pascal OSErr CmGetProductInfo (CameraData cameraData, CmProductInfoPtr productInfo);pascal OSErr CmRestoreDefaults(CameraData cameraData);pascal OSErr CmSetDateAndTime (CameraData cameraData, CmDateAndTimePtr dateAndTime);pascal OSErr CmSetOwnerName (CameraData cameraData, BufferPtr* ownerName);pascal OSErr CmSetPictureMode (CameraData cameraData, unsigned char pictureMode);pascal OSErr CmSetFlashMode(CameraData cameraData, Boolean flashMode);pascal OSErr CmSetSleep (CameraData cameraData, short sleepDelay);pascal OSErr CmGetDecompTable (CameraData cameraData, BufferPtr decompTablePtr);pascal OSErr CmGetColorCorrectionMatrix (CameraData cameraData, CmColorMatrixPtr colorMatrix);pascal OSErr CmGetErrorInfo (CameraData cameraData, shortPtr category, shortPtr detail);pascal OSErr CmCheckIfReady (CameraData cameraData);pascal OSErr CmSelfTest (CameraData cameraData);Retrieving and Capturing Imagespascal OSErr CmGetThumbnailImage (CameraData cameraData, unsigned short pictureNo, BufferPtr thumbnailBuffer, unsigned long numberOfBytesToRead, Boolean firstRead, LongPtr actualBytes);pascal OSErr CmGetThumbnailImageAsync(CameraData cameraData, unsigned short pictureNo, BufferPtr thumbnailBuffer, unsigned long numberOfBytesToRead, Boolean firstRead, CmAsyncCompletionRoutinePtr asyncCompletionRoutine);pascal OSErr CmGetFullSizeImage(CameraData cameraData, unsigned short pictureNo, BufferPtr imageBuffer, unsigned long numberOfBytesToRead, Boolean firstRead, LongPtr actualBytes);pascal OSErr CmGetFullSizeImageAsync(CameraData cameraData, unsigned short pictureNo, BufferPtr imageBuffer, unsigned long numberOfBytesToRead, Boolean firstRead, CmAsyncCompletionRoutinePtr asyncCompletionRoutine);pascal OSErr CmTakePicture(CameraData cameraData, Boolean timerOn);pascal OSErr CmTakePictureAsync(CameraData cameraData, Boolean timerOn, CmAsyncCompletionRoutinePtr asyncCompletionRoutine);Result CodesnoErr 0 No error. kCmAIPError -6201 An asynchronous operation is already in progress. Windows platform only. kCmAlreadyOpenError -6202 The CM is already open.kCmANIPError -6203 No asynchronous operation is outstanding. kCmBadArgError -6204 Parameter is or contains an address of an invalid data item. kCmCameraError -6200 Error detected by the camera. Call CmGetErrorInfo.kCmCameraNotFoundError -6206 Device connected to the port is not a QuickTake 100 camera.kCmCantCancel Currently outstanding asynchronous operation cannot be canceled. kCmCurrentlyConnectedError -6205 The camera is already connected.kCmCommError -6214 A serial communication error occurred.kCmDriverNotLoadedError -6213 The camera device driver was not initialized.kCmNoMemoryError -6209 System failed to allocate memory.kCmNotConnectedError -6208 A connection with the camera has not been made. kCmNoSuchPortError -6210 Corresponding port does not exist.kCmNotOpenError -6211 The CM has not been initialized.kCmProtocolError -6212 Protocol error during communication with a QuickTake 100 camera.kCmSystemError Windows DLL failed to either register its class or to create a window. kNoPortErr -7947 Corresponding port does not exist. kNoPodErr -7937 Device connected to the port is not a QuickTake 100 camera.kSoftwareInstallErr -7945 Either or both the GeoPort or Shared Library Manager extensions are not installed. Macintosh platform only. memFullErr -108 Not enough memory to process the requested operation. Macintosh platform only. paramErr -50 Parameter is or contains an address of an invalid data item. Macintosh platform only. QuickTake 100 ImagesThe information in this chapter applies to QuickTake 100 images on the Macintosh and Windows platforms. This chapter provides a brief description of the QuickTake 100 file format, information about the memory requirements for the display formats supported by the Macintosh and Windows image processing software, and information about the color depth of each display format. For information about how to display QuickTake 100 images in Windows applications, see Chapter 4, “Displaying QuickTake 100 Images in a Windows Application.” For information about how to display QuickTake 100 images in Macintosh applications, see Chapter 5, “Displaying QuickTake 100 Images in a Macintosh Application.”QuickTake 100 images are stored in the camera in a compressed format. You retrieve the compressed image data from the camera by making function calls to the QuickTake 100 device driver. The QuickTake 100 device driver loads the raw compressed image data from the camera into host memory. On the Windows platform, the image processing software provides function calls to decompress the raw image data in memory into a format that can be displayed on the host computer. On the Macintosh platform, a QuickTime decompressor provides the necessary image processing services. On the Macintosh platform, the QuickTake 100 files saved by the QuickTake 100 application contain a 512 byte header of application-specific data followed by an in-memory Macintosh PICT file and a QuickTake 100 thumbnail definition. QuickTake 100 files can be displayed on the Macintosh by taking all of the data in the file after the first 512 bytes and displaying that data with QuickDraw in the same way that a PICT file with a QuickTime compressed opcode is displayed. A sample code listing that shows how to use the QuickTake 100 device driver functions to retrieve raw image data from the QuickTake 100 camera is provided on page 2-5 in Chapter 2, “QuickTake 100 Driver Software.” QuickTake 100 Image SizesQuickTake 100 images are stored in three image resolutions: high-resolution, standard-resolution, and thumbnail. The amount of memory, in bytes, for three image resolutions in the output formats supported by the QuickTake 100 image processing software is shown in Table 3-1. Table 3-1 Memory sizes of supported QuickTake 100 image formats in bytes Image format High-resolution Standard-resolution Thumbnail (640 x 480 pixels) (320 x 240 pixels) (80 x 60 pixels) ADPCM compressed 115,200 28,800 n/a Color difference 307,200 76,800 4800 Thumbnail compressed n/a n/a 2400 8-bit grayscale 307,200 76,800 n/a 24-bit DIB 921,600 230,400 n/a 32-bit RGB 1,228,800 307,200 n/aDIB (device-independent bitmap) is the native image format for Microsoft Windows. This array of RGB triples contains only the image data. It is the responsibility of the Windows application programmer to imbed the data in the proper bitmap format. Image Color DepthThe QuickTake 100 image processing software converts QuickTake 100 images into display-ready pictures with the color depth and display formats shown in Table 3-2. Table 3-2 Picture display formats and color resolutions Display format Bits per pixel Colors Operating-system support Grayscale 8 256 Macintosh, MS Windows DIB 24 16.7 million Windows RGB 32* 16.7 million Macintosh* The 32-bits-per-pixel RGB format provides only 24 bits of color using the form NULL, Red, Green, Blue.Displaying QuickTake 100 Images in a Windows ApplicationThis chapter provides an overview of the technology used to process QuickTake 100 images for display with the Image Processing Module (IPM) in the Windows application environment. It also describes the data types and functions that are provided in the Windows IPM dynamic link library for the QuickTake 100 camera. This chapter does not attempt to teach Windows programming. You should be familiar with the software tools required to use the IPM DLL in the Windows programming environment.For information about how to display QuickTake 100 images in the Macintosh application environment, see Chapter 5, “Displaying QuickTake 100 Images in a Macintosh Application.” Using the Windows IPMImages are stored in the QuickTake 100 camera in a compressed format that cannot be readily displayed by the operating system. Therefore, it is necessary to decompress and convert the QuickTake 100 images into a data format that the operating system can display. The IPM DLL provides the functions that Windows applications call to decompress and convert QuickTake 100 images retrieved from the camera into a format that the operating system can display on the host computer. The IPM DLL for Windows is a collection of functions that convert QuickTake 100 camera images to display-ready RGB picture formats. The QuickTake 100 image processing software supports display of grayscale, RGB, and DIB output formats. The IPM supports differential pulse-code modulation (DPCM) decompression, edge enhancement, and color correction. The default color correction settings of a QuickTake 100 image can be overridden with the IPM software to accommodate different video display characteristics. In addition, IPM functions are provided for image rotation and for adjusting color output using camera-specific color characteristics.There are two fundamental methods that can be used for the QuickTake 100 image decompression and conversion process with the IPM: banded and unbanded. The banded method handles a user-specified strip of the image, while the unbanded method handles the complete image in memory. You may wish to try different band sizes to optimize the image conversion process for various system configurations. An image band is a full-width portion of an image that can begin with any line and extend to the height of the image. Banded image processing is provided for situations in which there is not enough memory on the host to process a full image or when only a full-width portion of the image is needed. An example of the latter case might be for redisplaying a portion of an image that was previously covered by another window. You can also use banded processing to display bands of a picture as they are processed to indicate progress to the user. NoteNoteWhen rotating an image using either the banded or unbanded image processing method, the full-color difference image must be resident in memory. Banded processing does not apply to thumbnail images.u Banded image processing is performed with the IpConvertADPCMtoRGB function. The portion of the image to process is specified with the aStartingLine and aLinesPerBand fields in the ImageAttribute data structure. The value of aStartingLine must be 0 or an even number, and aLinesPerBand must be an even number that is greater than or equal to 2. To process the full image with a single call (unbanded processing), set aStartingLine to 0 and aLinesPerBand to the total image height in pixels. The ImageAttribute data structure is shown here and further defined in “Data Types for the Windows IPM Functions” beginning on page 4-4. typedef struct imageAttribute { /* input */ unsigned short aImgWidth; unsigned short aImgLength; /* output image attributes */ IpPixelType aPixelType; RotateAngle aAngle; unsigned short aStartingLine; unsigned short aLinesPerBand; Boolean firstBand; Boolean lastBand;} ImageAttribute;The firstBand and lastBand fields in the ImageAttribute data structure can be used to optimize performance and to manage memory more efficiently. When firstBand is TRUE, the IPM allocates a color difference image (CDI) buffer as needed or reuses the buffer from a previously processed image. In either case, it decompresses the image to get the CDI. When firstBand is FALSE, it indexes into the existing CDI buffer, according to the value in the aStartingLine field, to process the requested band. NoteIn the Windows environment it is possible to have a CDI buffer for each application interested in using the IPM.u Table 4-1 shows how to use the firstBand and lastBand fields in the ImageAttribute data structure to process two images using the CDI buffer allocated for the first image. The first image is processed in three bands, and the second image is processed in the same CDI buffer in one band. Table 4-1 Memory and image band processing Image Band firstBand lastBand Memory use and processing technique 1 1 TRUE FALSE Allocate the CDI working buffer, decompress the image, and generate the CDI. After processing, the CDI buffer is retained. 1 2 FALSE FALSE Previously allocated CDI buffer is used to process the second band. After processing, the CDI buffer is retained. 1 3 FALSE FALSE Previously allocated CDI buffer is used to process the third band. After processing, the CDI buffer is retained. 2 1 TRUE TRUE Previously allocated CDI buffer is used to process the requested band of the second image. After processing, the CDI buffer is deallocated (lastBand = True). IPM Error HandlingAll IPM functions return a value either indicating successful completion or detailing a failure status. The include file ipm.h defines the values and mnemonics for these conditions. Errors also appear in the “Result Codes” section for each function description. Image Processing Module ReferenceThe following sections describe the data types and functions supported by the Image Processing Module. NoteThis information is provided to give Windows programmers an idea of how to use the QuickTake 100 image processing software that will be available sometime in 1994.u Data Types for the Windows IPM FunctionsThis section describes all of the data types referenced by the IPM functions. These declarations can be found in the ipm.h file. ImageAttributeThe ImageAttribute structure provides information about the size of the QuickTake 100 source image and defines the parameters to be used by the IPM for the image output. typedef struct imageAttribute { /* input */ unsigned short aImgWidth; unsigned short aImgLength; /* output image attributes */ IpPixelType aPixelType; RotateAngle aAngle; /* image banding parameters */ unsigned short aStartingLine; unsigned short aLinesPerBand; Boolean firstBand; Boolean lastBand;} ImageAttribute;Field descriptionsaImgWidth Horizontal size of image, in pixels. aImgLength Vertical size of image, in pixels. aPixelType Color or gray; bits per pixel. kGray8 = 8-bit (256 levels of gray)kDIB24 = 24-bit (16 million colors) aAngle Rotation angle of output image. See the RotateAngle structure described on page 4-6. aStartingLine Starting line number of the output band. aLinesPerBand Number of full-width lines in band. firstBand Set to TRUE for first band of an image. lastBand Set to TRUE for free working buffers. Be sure to set up the ImageAttribute structure to disable banded processing when decompressing thumbnail data. Both the aStartingLine and aLinesPerBand fields must be set to 0, or a call to IpConvertThumbnailToRGB will return a kCmBadArgError error. For more information about decompressing thumbnail image data, see the description of IpConvertThumbnailToRGB function on page 4-10. When you display a rotated image, set the aStartingLine and aLinesPerBand fields so that they refer to the entire rotated image. For example, a 320 by 240 image rotated either 90 degrees or 270 degrees will have a height of 320 lines when fully rotated. The span of the image will range from 0 to 320 during banded processing. The aImgWidth and aImgLength fields refer to the nonrotated image values. For more information about image processing, see the discussion of image processing starting on page 4-2 and the description of the IpConvertADPCMToRGB function on page 4-11. CharacteristicsThe Characteristics structure controls the CRT RGB display phosphor chromaticity values and CRT gamma. typedef struct characteristics { XYChroma redChroma; XYChroma greenChroma; XYChroma blueChroma; double gamma;} Characteristics;Field descriptionsredChroma Red phosphor chromaticity. greenChroma Green phosphor chromaticity. blueChroma Blue phosphor chromaticity. gamma CRT gamma, color temperature in Kelvins. XYChromaThe XYChroma structure provides the CRT RGB display phosphor and white-point chromaticity x and y values. typedef struct xyChroma { double xChroma; double yChroma; } XYChroma;Field descriptionsxChroma Value for x chromaticity. yChroma Value for y chromaticity. RotateAngleThe RotateAngle structure provides the values for rotating a QuickTake 100 image counterclockwise. typedef enum rotateAngle { /* counterclockwise rotation */ kImgRot0 = 0, /* 0-degree rotation */ kImgRot90 = 1, /* 90-degree rotation */ kImgRot180 = 2, /* 180-degree rotation */ kImgRot270 = 3 /* 270-degree rotation */} RotateAngle;Field descriptionsKImgRot0 Zero (0) degrees of rotation. kImgRot90 90 degrees of rotation. kImgRot180 180 degrees of rotation. kImgRot270 270 degrees of rotation. ProgressCallBackProgressCallBack is the prototype structure of an application progress callback function. typedef struct ProgressCallBack { IpProgressProcPtr callBackProc; long refcon;} ProgressCallBack;Field descriptionscallBackProc Application progress callback procedure.refcon Reference constant. IPM Functions for Microsoft Windows ApplicationsThe IPM functions described in this section perform operations on the compressed image data that is retrieved from the QuickTake 100 camera. These functions convert compressed QuickTake 100 images into formats that can be displayed on computers capable of running Microsoft Windows. To use these functions, be sure to include the ipm.h file in the include section of your code. NoteAll parameter pointers are of type far unless otherwise noted. uNoteOn the Macintosh computer, QuickTake 100 images are converted into display-ready PICT format files by a QuickTake 100 QuickTime decompressor. Converted QuickTake 100 images are shown on the Macintosh display using the same techniques used to display PICT files with QuickTime or QuickDraw. uIpInitIPMOSErr FAR PASCAL IpInitIPM(unsigned char far * ipm);ipm Address that will contain the IPM private data structures for the application. This area of memory must be allocated by the application before this function is called. Be sure this memory area has been cleared prior to calling IpInitIPM. The size of this memory area is defined by the constant kIPMContextSize. DESCRIPTIONThe IpInitIPM function initializes the IPM. This function must be called once before any other IPM routines are called. During the initialization process IPM fills in the image processing data structures with default settings for the camera matrix and display characteristics. However, the values are not actually set prior to a call to the IpCalculateColorTables function. Therefore, you must first call the IpInitIPM function and then call IpCalculateColorTables before any image processing can take place. If you change the settings for the default camera color matrix and display characteristics during a session with the IPM, those changes are not actually put to use until an IpCalculateColorTables function is called. RESULT CODESUpon successful completion, this function returns noErr and the IPM initializes the necessary internal data structures for use by subsequent function calls from the application. If an error is detected, this function returns one of the values listed here:kIpBadArgError Parameter is or contains an address of an invalid data item.kIpContextExistsError The memory referenced by the ipm parameter has already been allocated by a previous call to IpInitIPM. kIpNoMemoryError System failed to allocate system memory. SEE ALSOIpEndIPM, described next; IpCalculateColorTables on page 4-9IpEndIPMOSErr FAR PASCAL IpEndIPM(unsigned char far * ipm);ipm Address of the private storage for the IPM. See the definition of the IpInitIPM function on page 4-8 for more information about the ipm parameter. DESCRIPTIONThe IpEndIPM function closes the IPM and deallocates associated memory allocated with the IpInitIPM function. The IpEndIPM function should always be called before exiting the IPM. The application is responsible for disposing of any application memory associated with using the IPM.RESULT CODESThis function returns the value noErr upon successful completion.If an error is detected, this function returns one of these values:kIpBadArgError Parameter is or contains an address of an invalid data item.kIpNoContextExistsError This function was called without a previous call to IpInitIPM. SEE ALSOIpInitIPM on page 4-8IpCalculateColorTablesOSErr FAR PASCAL IpCalculateColorTables(unsigned char far * ipm);ipm Pointer to the memory allocated for the IPM.DESCRIPTIONThe IpCalculateColorTables function calculates and initializes the color processing tables with the current camera color matrix and display characteristics. The camera color matrix and display characteristics are modified with the IpSetCameraColorMatrix and IpSetDisplayCharacteristics functions. You must call the IpCalculateColorTables function after initializing the IPM with IpInitIPM before attempting to process QuickTake 100 images. You can call IpSetDisplayCharacteristics and IpSetCameraColorMatrix followed by a single call to IpCalculateColorTables to calculate the new color tables. In addition, if you only need to calculate the color tables after changing the camera color matrix or calculate the display characteristics after changing the display characteristics, you can follow either IpSetDisplayCharacteristics or IpSetCameraColorMatrix with a call to IpCalculateColorTables. This is also true for the IpInitDisplayCharacteristics and IpInitCameraColorMatrix functions. RESULT CODESThis function returns noErr upon successful completion.If an error is detected, IpCalculateColorTables returns one of the values listed here:kIpBadArgError Parameter is or contains an address of an invalid data item.kIpNoContextExistsError The ipm parameter does not point to valid data.SEE ALSOIpInitIPM on page 4-8, IpSetDisplayCharacteristics on page 4-14, IpInitDisplayCharacteristics on page 4-15, IpSetCameraColorMatrix on page 4-17, IpInitCameraColorMatrix, on page 4-17 IpConvertThumbnailToRGBOSErr FAR PASCAL IpConvertThumbnailToRGB(unsigned char far * ipm, unsigned char far * pCompedTNail, unsigned char far * pTNailRGB, ImageAttribute far * imgAttr);ipm Pointer to the memory allocated for the IPM.pCompedTNailPointer to the compressed thumbnail image.pTNailRGB Pointer to the output RGB image.imgAttr Pointer to the ImageAttribute data structure that describes the image referenced in pCompedTNail. Banded image processing does not apply to thumbnail images. Be sure to set the aStartingLine and aLinesPerBand fields in the ImageAttribute structure to 0 when processing thumbnail images. DESCRIPTIONThe IpConvertThumbnailToRGB function decompresses a thumbnail image and prepares it for display as specified by the ImageAttribute data structure pointed to by the imgAttr parameter.RESULT CODESThis function returns noErr upon successful completion.If an error is detected, this function returns one of the values listed here:kIpBadArgError Parameter is or contains an address of an invalid data item.kIpColorTablesNotCalculated Color parameters were initialized or changed without calculating the derived color processing tables. You must call IpCalculateColorTables before image processing can take place.kIpNoContextExistsError The ipm parameter does not point to valid data.kIpNoMemoryError System failed to allocate memory. SEE ALSOIpInitIPM on page 4-8, IpCalculateColorTables on page 4-9IpConvertADPCMtoRGBOSErr FAR PASCAL IpConvertADPCMtoRGB(unsigned char far * ipm, unsigned char huge * pCompedCDI, unsigned char huge * pRGB, ImageAttribute far * imgAttr, ProgressCallBack far * callBackProc);ipm Pointer to the memory allocated for the IPM. pCompedCDIPointer to the QuickTake 100 compressed color difference image.pRGB Pointer to the RGB image output.imgAttr Pointer to the ImageAttribute structure that describes the input and output images referenced by pCompedCDI and pRGB, respectively. When rotating images 90 or 270 degrees without using banded processing, the aLinesPerBand field in the ImageAttribute structure must be set to the rotated image height (either 640 for high-resolution images or 320 for standard-resolution images). When doing banded processing at 90 or 270 degrees, be sure to continue the process through the full rotated image height. callBackProcAddress of a callback procedure to receive progress status.DESCRIPTIONThe IpConvertADPCMtoRGB function decompresses an ADPCM QuickTake 100 image and converts it, as specified by the ImageAttribute structure, to a display-ready format. The image is color corrected for display (color IpPixelTypes only). The resulting image is stored at the address specified in the pRGB parameter. RESULT CODESThis function returns noErr upon successful completion.If an error is detected, this function returns one of the values listed here:kIpAppCancel Operation has been canceled by the application.kIpBadArgError Parameter is or contains an address of an invalid data item.kIpColorTablesNotCalculated Color parameters were initialized or changed without calculating the derived color processing tables. You must call IpCalculateColorTables before image processing can take place.kIpNoContextExistsError The ipm parameter does not point to valid data.kIpNoMemoryError System failed to allocate memory. SEE ALSOIpProgressProc, described nextIpProgressProctypedef OSErr (FAR PASCAL *IpProgressProcPtr) (short message, short percentComplete, long refcon); message Indicates the reason for the call. Valid messages are IpProgressInit, IpProgressUpdate, and IpProgressEnd. The IpProgressInit and IpProgressEnd messages may be used to create and dismiss the application’s progress indicator display.percentCompleteFor messages of type IpProgressUpdate only, should be the percentage of completion for the currently executing IPM function. This value is an integer between 0 and 100.refcon Reference constant specified by the application and returned to the given callback procedure. DESCRIPTIONThe IpProgressProc callback procedure prototype provides a way for applications to monitor the time it takes to convert a compressed QuickTake 100 image into a display-ready RGB format. When an application-supplied callback procedure is passed to the IpConvertADPCMtoRGB function, that callback procedure will be called periodically as the image is processed to provide a progress indicator to the application. The application may choose to filter the callback status to the desired level and return without providing any user feedback. RESULT CODESThis function returns noErr as long as the asynchronous operation is successful. If an error is detected during the operation, this function returns one of the values listed here:kIpBadArgError The application received an invalid parameter.kIpCancel The application wants to cancel the process. The IPM will discontinue its process and return the value kIpAppCancel. SEE ALSOIpConvertADPCMtoRGB on page 4-11IpGetDisplayCharacteristicsOSErr FAR PASCAL IpGetDisplayCharacteristics (unsigned char far * ipm, Characteristics far * characteristics);ipm Pointer to the memory allocated for the IPM. characteristicsPointer to the Characteristics structure for the current display. For information about the values returned by this function, see the description of the Characteristics data structure on page 4-6. DESCRIPTIONThe IpGetDisplayCharacteristics function returns the current CRT display characteristics in the area pointed to by the characteristics parameter. RESULT CODESThis function returns noErr upon successful completion.If an error is detected, this function returns one of these values:kIpBadArgError The application received an invalid parameter.kIpNoContextExistsError The ipm parameter does not point to valid data.SEE ALSOIpSetDisplayCharacteristics, described next; IpInitDisplayCharacteristics on page 4-15IpSetDisplayCharacteristicsOSErr FAR PASCAL IpSetDisplayCharacteristics (unsigned char far * ipm, Characteristics far * characteristics);ipm Pointer to the memory allocated for the IPM.characteristicsPointer to the new display characteristics structure. All supported display characteristics must be set when calling this function. You should retrieve the characteristics first, then modify them as necessary before passing them to this function. This function supports the CRT chromaticities and gamma characteristics. For information about the values you can set with this function, see the description of the Characteristics structure on page 4-6. DESCRIPTIONThis function sets the values for a new color correction matrix using the given CRT display characteristics. It is used to customize the color processing of a QuickTake 100 image for accurate color reproduction on different display hardware. After calling IpSetDisplayCharacteristics, call the IpCalculateColorTables function to calculate and initialize the new display characteristics for subsequent image processing. The IpCalculateColorTables function is described on page 4-9. RESULT CODESThe IpSetDisplayCharacteristics function returns noErr upon successful completion.If an error is detected, this function returns one of the values listed here:kIpBadArgError Parameter is or contains an address of an invalid data item.kIpNoContextExistsError The ipm parameter does not point to valid data.SEE ALSOIpCalculateColorTables on page 4-9, IpGetDisplayCharacteristics on page 4-13, IpInitDisplayCharacteristics, described nextIpInitDisplayCharacteristicsOSErr FAR PASCAL IpInitDisplayCharacteristics (unsigned char far * ipm);ipm Pointer to the memory allocated for the IPM.DESCRIPTIONThis function replaces the current CRT display characteristics and derived color processing tables with the default values shown in Table 4-2 and Table 4-3. After calling IpInitDisplayCharacteristics, make a call to the IpCalculateColorTables function to calculate and set the default display characteristics for subsequent image processing. The IpCalculateColorTables function is described on page 4-9. Table 4-2 Default CRT display characteristicsCharacteristic X value Y valueredChroma 0.640 0.330greenChroma 0.300 0.600blueChroma 0.150 0.060Table 4-3 Default CRT display gamma characteristicCharacteristic Valuegamma 2.3RESULT CODESThe IpInitDisplayCharacteristics function returns noErr upon successful completion.If an error is detected, this function returns one of the values listed here:kIpBadArgError Parameter is or contains an address of an invalid data item.kIpNoContextExistsError The ipm parameter does not point to valid data.SEE ALSOCharacteristics data structure on page 4-6, IpCalculateColorTables on page 4-9, IpGetDisplayCharacteristics on page 4-13, IpSetDisplayCharacteristics on page 4-14IpGetCameraColorMatrixOSErr FAR PASCAL IpGetCameraColorMatrix(unsigned char far * ipm, double far * cameraMatrix);ipm Pointer to the memory allocated for the IPM. cameraMatrixAddress at which the current camera color matrix is returned.DESCRIPTIONThe IpGetCameraColorMatrix function returns the current camera color matrix in the user-specified location. The memory allocated to receive this information must be large enough to contain a 3-by-4 color matrix of type double. IMPORTANTSince the color matrix and image compression schemes in the camera may change in the future, it is always important to check the version number of the color matrix. You must make adjustments in your image processing setup, based on the version number of the color matrix in the camera as follows: If the color matrix in the camera is version 1, use the default color matrix in the Windows IPM and pass that matrix back to the IPM for image processing. If it is not version 1, pass the color matrix returned by the camera to the IPM for subsequent image processing. See the IpInitCameraColorMatrix function on page 4-17 for information about initializing the default color matrix in the IPM. RESULT CODESThe IpGetCameraColorMatrix function returns noErr upon successful completion.If an error is detected, it returns one of the values listed here:kIpBadArgError Parameter is or contains an address of an invalid data item.kIpNoContextExistsError The ipm parameter does not point to valid data.SEE ALSOIpSetCameraColorMatrix, described next; IpInitCameraColorMatrix on page 4-17IpSetCameraColorMatrixOSErr FAR PASCAL IpSetCameraColorMatrix(unsigned char far * ipm, double far * cameraMatrix);ipm Pointer to the memory allocated for the IPM. cameraMatrixAddress of the new 3-by-4 camera color matrix. DESCRIPTIONThe IpSetCameraColorMatrix function replaces values in the current camera color matrix with the user-supplied color tables in the cameraMatrix parameter. It is used to customize the color correction process to accommodate different display hardware and maintain compatibility with possible future changes in the color matrix used in the camera during the image capturing process. After calling IpSetCameraColorMatrix, call the IpCalculateColorTables function to calculate and initialize the new color matrix for subsequent image processing. The IpCalculateColorTables function is described on page 4-9. RESULT CODESThis function returns noErr upon successful completion.If an error is detected, IpSetCameraColorMatrix returns one of the values listed here:kIpBadArgError Parameter is or contains an address of an invalid data item.kIpNoContextExistsError The ipm parameter does not point to valid data.SEE ALSOIpCalculateColorTables on page 4-9, IpGetCameraColorMatrix on page 4-16, IpInitCameraColorMatrix, described nextIpInitCameraColorMatrixOSErr FAR PASCAL IpInitCameraColorMatrix(unsigned char far * ipm);ipm Pointer to the memory allocated for the IPM. DESCRIPTIONThe IpInitCameraColorMatrix function replaces the current camera color matrix with default IPM color matrix values. After calling IpInitCameraColorMatrix, call the IpCalculateColorTables function to calculate and initialize the default color matrix for subsequent image processing. The IpCalculateColorTables function is described on page 4-9. RESULT CODESThe IpInitCameraColorMatrix function returns noErr upon successful completion and restores the default camera color matrix.If an error is detected, it returns one of the values listed here:kIpBadArgError Parameter is or contains an address of an invalid data item.kIpNoContextExistsError The ipm parameter does not point to valid data.SEE ALSOIpCalculateColorTables on page 4-9, IpGetCameraColorMatrix on page 4-16, IpSetCameraColorMatrix on page 4-17IpGetCompressionTableOSErr FAR PASCAL IpGetCompressionTable(unsigned char far * ipm, unsigned char far * compTable);ipm Pointer to the memory allocated for the IPM.compTable Address in which to store the current compression table. DESCRIPTIONThe IpGetCompressionTable function returns the compression table currently in use by the IPM at the location specified with the compTable parameter. The compTable memory area must be large enough to contain the entire compression table, which is specified by the value of the constant kIpDecompTableSize (98 bytes). This function is useful when you want to ensure that the compression table you specified in an IpSetCompressionTable function call has been properly passed to the IPM. RESULT CODESThe IpGetCompressionTable function returns noErr upon successful completion.If an error is detected, IpGetCompressionTable returns one of the values listed here:kIpBadArgError Parameter is or contains an address of an invalid data item.kIpNoContextExistsError The ipm parameter does not point to valid data.SEE ALSOIpSetCompressionTable, described next; IpInitCompressionTable on page 4-9IpSetCompressionTableOSErr FAR PASCAL IpSetCompressionTable(unsigned char far * ipm, unsigned char far * compTable);ipm Pointer to the memory allocated for the IPM.compTable Address of the new compression table. DESCRIPTIONThe IpSetCompressionTable function replaces the current compression table with the table specified by the compTable parameter. The compression table is retrieved from the camera with the CmGetDecompTable camera driver function, and it must be passed to the IPM unaltered to maintain image decompression compatibility with the associated images. Any time you start a new session with the QuickTake 100 camera, you should retrieve the compression table and set it so that the IPM can use the appropriate compression table when processing any images downloaded during that session. The CmGetDecompTable function allows an application to retrieve the current version of the compression table in the QuickTake 100 camera. It is described on page 2-45 in Chapter 2, “QuickTake 100 Driver Software.”RESULT CODESThe IpSetCompressionTable function returns noErr upon successful completion.If an error is detected, IpSetCompressionTable returns one of the values listed here:kIpBadArgError Parameter is or contains an address of an invalid data item.kIpNoContextExistsError The ipm parameter does not point to valid data.SEE ALSOCmGetDecompTable on page 2-45, IpGetCompressionTable on page 4-18, IpInitCompressionTable, described nextIpInitCompressionTableOSErr FAR PASCAL IpInitCompressionTable(unsigned char far * ipm);ipm Pointer to the memory allocated for the IPM. DESCRIPTIONThe IpInitCompressionTable function replaces the current compression table with the default compression table values. A default compression table is stored within the IPM. You can check to see if the default compression table matches the current camera compression table by calling the IpInitCompressionTable function followed by a IpGetCompressionTable call to get the default compression table and then compare the default compression table to the table returned by a CmGetDecompTable function. RESULT CODESThis function returns noErr upon successful completion. If an error is detected, IpInitCompressionTable returns one of the values listed here:kIpBadArgError Parameter is or contains an address of an invalid data item.kIpNoContextExistsError The ipm parameter does not point to valid data.SEE ALSOCmGetDecompTable on page 2-45, IpGetCompressionTable on page 4-18, IpSetCompressionTable on page 4-19 C-Language Summary of the Image Processing ModuleConstantskIPMContextSize (4096)kIpDecompTableSize 98IpProgressInit 0IpProgressUpdate 1IpProgressEnd 2kGray8 = 0 /* 8-bit grayscale */kDIB24 /* 24-bit DIB BMP */kImgRot0 = 0, /* 0-degree rotation */kImgRot90 = 1, /* 90-degree rotation */kImgRot180 = 2, /* 180-degree rotation */kImgRot270 = 3 /* 270-degree rotation */Data TypesImageAttributetypedef struct imageAttribute { /* image size */ unsigned short aImgWidth; unsigned short aImgLength; /* output image attributes: */ IpPixelType aPixelType; RotateAngle aAngle; /* image banding parameters */ unsigned short aStartingLine; unsigned short aLinesPerBand; Boolean firstBand; Boolean lastBand;} ImageAttribute;Characteristicstypedef struct characteristics { XYChroma redChroma; XYChroma greenChroma; XYChroma blueChroma; double gamma;} Characteristics; XYChromatypedef struct xyChroma { double xChroma; double yChroma; } XYChroma; RotateAngletypedef enum rotateAngle { /* (counterclockwise rotation) */ kImgRot0 = 0, /* 0-degree rotation */ kImgRot90 = 1, /* 90-degree rotation */ kImgRot180 = 2, /* 180-degree rotation */ kImgRot270 = 3 /* 270-degree rotation */} RotateAngle; FunctionsOSErr FAR PASCAL IpInitIPM (unsigned char far * ipm);OSErr FAR PASCAL IpEndIPM (unsigned char far * ipm);OSErr FAR PASCAL IpConvertThumbnailToRGB (unsigned char far * ipm, unsigned char huge * pCompedTNail, unsigned char huge * pTNailRGB, ImageAttribute far * imgAttr);typedef struct progressCallBack { IpProgressProcPtr callBackProc; long refcon;} ProgressCallBack; OSErr FAR PASCAL IpConvertADPCMtoRGB (unsigned char far * ipm, unsigned char huge * pCompedCDI, unsigned char huge * pRGB, ImageAttribute far * imgAttr, ProgressCallBack far * CallBackProc);OSErr FAR PASCAL IpGetDisplayCharacteristics (unsigned char far * ipm, Characteristics far * characteristics);OSErr FAR PASCAL IpSetDisplayCharacteristics (unsigned char far * ipm, Characteristics far * characteristics);OSErr FAR PASCAL IpInitDisplayCharacteristics (unsigned char far * ipm);OSErr FAR PASCAL IpGetCameraColorMatrix (unsigned char far * ipm, double far * cameraMatrix);OSErr FAR PASCAL IpSetCameraColorMatrix (unsigned char far * ipm, double far * cameraMatrix);OSErr FAR PASCAL IpInitCameraColorMatrix (unsigned char far * ipm);OSErr FAR PASCAL IpGetCompressionTable (unsigned char far * ipm, unsigned char far * compTable);OSErr FAR PASCAL IpSetCompressionTable (unsigned char far * ipm, unsigned char far * compTable); OSErr FAR PASCAL IpInitCompressionTable (unsigned char far * ipm); Result CodesnoErr Operation was successful. kIpAppCancel Operation canceled by the application. kIpBadArgError Parameter is or contains an address of an invalid data item. kIpCancel The application wants to cancel the process. The IPM will discontinue its process and return the value kIpAppCancel.KIpColorTablesNotCalculated Color parameters were changed without calculating the derived color processing tables. Call IpCalculateColorTables before attempting to process another image. kIpContextExistsError The IPM is already open. This error occurs when IpInitIPM is called twice without an intervening call to IpEndIPM. kIpNoContextExistsError The ipm parameter does not point to valid data. kIpNoMemoryError System failed to allocate memory. Displaying QuickTake 100 Images in a Macintosh ApplicationThis chapter describes the method used to display QuickTake 100 images with an application running in the Macintosh Operating System. The information presented here is for programmers who already understand how to use QuickTime, QuickTime Compressors, and QuickDraw to decompress and display picture files on the Macintosh computer. QuickTake 100 QuickTime DecompressorAs described in Chapter 3, images captured in the QuickTake 100 camera are stored in compressed format that must be decompressed and converted to a picture format that can be displayed by the host operating system. Images stored on the camera must be retrieved from the camera with the QuickTake 100 device driver functions, described in Chapter 2, before decompression and conversion operations can be performed. QuickTake 100 image processing support for the Macintosh Operating System is incorporated in a QuickTake 100 QuickTime decompressor. The QuickTake 100 QuickTime decompressor takes care of the details that would otherwise be associated with using the IPM functions to process the QuickTake 100 image data. Instead of manipulating the QuickTake 100 image data directly with the IPM functions, your application passes the QuickTake 100 image data along with an image description record that describes the image data to the QuickTake 100 QuickTime decompressor. The image description record is filled in with a file type of 'qktk', the height and width fields are set for the height and width of the image in pixels, and the dataSize field is set to the size of the compressed data in bytes. The QuickTake 100 decompressor then processes the data to create a Macintosh display-ready picture file. To show the pictures on the Macintosh display, you will need to understand how to use QuickTime, the Image Compression Manager, and QuickDraw in your application. You should also be familiar with the ImageAttribute data structure described on page 4-5. Refer to Chapter 3 of Inside Macintosh: QuickTime for information about the Image Compression Manager. QuickTake 100 images are converted into display-ready PICT format files by the QuickTake 100 QuickTime decompressor and the Image Compression Manager without your application having to call any of the IPM functions described in Chapter 4, “Displaying QuickTake 100 Images in a Windows Application.” Converted QuickTake 100 images are shown on the Macintosh display using the same techniques used to display PICT files with QuickTime or QuickDraw. QuickTake 100 Serial InterfaceThis appendix contains information about the QuickTake 100 serial interface and connector. The serial interface is used by host computers to both control the QuickTake 100 camera and retrieve data from the QuickTake 100 camera. Serial PortThe serial port on QuickTake 100 is located on the left side of the camera, as shown in Figure A-1.Figure A-1 QuickTake 100 serial port locationIt is an 8-pin mini-DIN socket with the physical pattern shown in Figure A-2. This is the same type of serial connector used on most Macintosh computers.Figure A-2 QuickTake 100 serial port physical patternProtocol, Transfer Rate, and Data FormatThe QuickTake 100 serial port supports Macintosh GeoPort high-speed serial communication protocols up to 920 kilobits per second (Kbps) and standard RS-232C serial protocols up to 57,600 bits per second (bps). The GeoPort software built into the QuickTake 100 camera and the GeoPort system extension on the Macintosh computer take care of setting up the appropriate communication protocol and transfer rate for a serial connection. At system startup time, the GeoPort software performs what is called a beaconing phase. During the GeoPort beaconing phase many device-specific chores are attended to; one of these includes determining the fastest possible data transfer rate that can be supported by both QuickTake 100 and the Macintosh computer to which it is connected. For computers that support Microsoft Windows, the QuickTake 100 camera uses the RS-232C serial protocol with a default transfer rate of 9600 bps and a data format of 8 data bits, with 1 stop bit, and even parity. The QuickTake 100 software supports transfer rates of 9600, 19,200, 38,400, and 57,600 bps for the Windows platform. QuickTake 100 Serial Port Pin AssignmentsThe QuickTake 100 serial port conforms to RS-422 differential driver and receiver specifications and has the pin assignments described in Table A-1. Table A-1 Serial port pin assignments Pin number Signal name Signal description 1 HSKo Handshake output. This is the clock out signal on the QuickTake 100 camera and is not used by the RS-232C standard serial protocol. 2 HSKi Handshake input. This is the reset in signal on the QuickTake 100 camera. 3 TxD– Transmit data. 4 GND Signal ground. 5 RxD– Receive data. 6 TxD+ Transmit data (not used by standard serial protocol). 7 GPi Not used. 8 RxD+ Receive data (not used by standard serial protocol).Serial CablesA serial cable for connecting the QuickTake 100 camera to Macintosh computers (a mini-DIN 8 to mini-DIN 8 twisted-pair cable configuration) and a serial cable for connecting computers that use a D-sub 9-pin connector are provided in the QuickTake 100 package (see Figure A-3 and Figure A-6). In addition, a D-sub 9-pin to D-sub 25-pin adapter is also provided (see Figure A-6). This section provides diagrams that show how the pins in those serial cables are connected to make the appropriate serial connection with a QuickTake 100 camera. To connect a Macintosh computer to the QuickTake 100 camera, use an Apple serial cable, part number M0197, or a cable with the pin and signal assignment connections shown in Figure A-4. Figure A-3 QuickTake 100-to-Macintosh serial cableFigure A-4 QuickTake 100-to-Macintosh serial cable pin assignmentsThe QuickTake 100-to-Macintosh cable is essentially a twisted-pair cable with the physical configuration shown in Figure A-5. Figure A-5 QuickTake 100-to-Macintosh twisted-pair cable configurationComputers, other than the Macintosh computer, that are capable of running Microsoft Windows use either D-sub 9-pin or D-sub 25-pin connectors conforming to the RS-232C specification. Figure A-6 shows the serial cable for connecting the QuickTake 100 mini-DIN 8-pin to a D-sub 9-pin connector and the adapter to connect the D-sub 9-pin cable end to a D-sub 25-pin RS-232C connector. Figure A-6 QuickTake 100 8-pin mini-DIN to RS-232C serial cable and adapterFigure A-7 shows how the pins and signals should be connected in a serial cable that connects the QuickTake 100 8-pin mini-DIN serial connector to an RS-232C D-sub 9-pin connector. The D-sub 9-pin to D-sub 25-pin adapter cable is a straight-through pin-to-pin configuration.Figure A-7 QuickTake 100 8-pin mini-DIN to D-sub 9-pin RS-232C serial cable pin assignmentsThe D-sub 9-pin end of the mini-DIN 8-pin to D-sub 9-pin cable has a female connector with the physical pinout shown in Figure A-8.Figure A-8 D-sub 9-pin physical pinout on a QuickTake 100 to D-sub 9-pin serial cableThe D-sub 9-pin end of a D-sub 9-pin to D-sub 25-pin RS-232C adapter cable has a male connector with the physical pinout shown in Figure A-9. Figure A-9 D-sub 9-pin physical pinout on a D-sub 9-pin to D-sub 25-pin adapter cableThe D-sub 25-pin end of a D-sub 9-pin to D-sub 25-pin RS-232C adapter cable has a female connector with the physical pinout shown in Figure A-10. Figure A-10 D-sub 25-pin physical pinout on a D-sub 9-pin to D-sub 25-pin adapter cableQuickTake 100 Camera SpecificationsThe specifications for the QuickTake 100 camera are listed in Table B-1. Table B-1 Venus specifications Feature Description Absolute accuracy ±0.5 pixel; any possible distortion is caused by the optical lens in front of the CCD sensor. Color temperature Flash operation 5500 kelvinsDaylight operation 6000 kelvins Exposure Automatic exposure adjustment Exposure time 1/175 to 1/30 seconds Flash Capacitive discharge flash tube 7-second interval between flashes (new battery)Flash range 4 to 15 feet Focus Fixed; 4 feet to infinity Image capture Color CCD (charged couple device) Image counter Additive, 0 to 32 depending on image-resolution setting Image compression DPCM (differential pulse code modulated) Image cycle time 5 seconds without flash Image resolution High-resolution image: 640H-by-480V-pixel resolution Standard-resolution image: 320H-by-240V-pixel resolution Thumbnail preview: 64H-by-48V-pixel resolution Lens 5-element antireflective coated lens with a range of 4 feet to infinite with fixed focus equivalent focal length to 40 mm in a 35-mm camera. Lens cover Horizontal sliding cover, actuates camera power on switch. Power source Three 1.5 V AA batteries AC line adapter 4 to 8 volts at 1.5 amps120 V ± 10% 48Hz–62Hz (U.S.) 100, 120, 200, 220, 240 V ± 10% 48Hz–62Hz (international) Self-timer Built-in electronic type with LED indicator Serial interface RS-422 GeoPort high-speed serialRS-232C standard serial protocol Serial transfer rate 9600 to 920 Kbps (Macintosh driver) 9600 to 57,600 bps (Windows driver) Shutter Programmable stepping motor drive, 2.8 to 16F, ± 0.5 EV accuracyIndexAapplication-defined routines2-33asynchronous camera operations, erasing images2-32asynchronous image retrieval2-60asynchronous retrieval of thumbnail images2-56asynchronous routines, canceling2-34Bbanded image processing4-2color difference image buffer4-4BufferPtr data type2-9Ccalculating the color tables4-9cameracapturing images2-63color correction matrix2-47, 4-16compression table2-45data types2-8 to 2-19default characteristics2-38default flash mode2-38default timeout2-38determining features2-36determining if connected2-52disconnecting2-28driver software for Macintosh platform1-3driver software for Windows platform1-4error category codes2-48error detail codes2-50 to 2-51establishing a connection2-3, 2-25factory settings2-38features1-4getting compression table2-45getting image information2-30getting information2-28image resolution1-2image types1-2owner name2-40picture types1-2product information2-37setting date and time2-39setting flash mode2-43setting owner name2-40setting picture mode2-41setting sleep mode2-44camera color matrix4-16camera connection functions2-22 to 2-28camera control functions2-28 to 2-53camera controls1-4 to 1-6erase all1-6flash1-5power on and off1-5resolution1-6shutter1-6timer1-6CameraData data type2-9camera data structures2-8 to 2-19camera device driver2-2asynchronous operations2-8closing2-21constants2-64data types2-8 to 2-19, 2-65 to 2-67defined2-2getting camera compression table2-45initializing2-3, 2-20opening2-3, 2-20using2-2camera device driver functions2-19 to 2-63errors2-2result code2-2camera errors2-48camera image retrieval functions2-54 to 2-61camera images2-30camera information2-37camera initialization functions2-20 to 2-22camera matrix4-8canceling asynchronous routines2-34capturing images1-2, 2-4capturing images asynchronously2-63Characteristics data type4-6, 4-22closing the camera connection2-4closing the camera device driver2-5, 2-21closing the Image Processing Module4-9CmAsyncCompletionRoutine function2-33 to 2-34CmCameraInfo data type2-14 to 2-17, 2-67CmCancelAsyncOperation function2-34 to 2-35CmCheckIfReady function2-52CmCloseDriver function2-5, 2-21CmColorMatrix data type2-19, 2-67CmConnect function2-3, 2-25 to 2-27CmDateAndTime data type2-12, 2-66CmDisconnect function2-4, 2-27 to 2-28CmDisposePortInfo function2-24 to 2-25CmErase function2-31CmGetCameraInfo function2-4, 2-28 to 2-29CmGetColorCorrectionMatrix function2-46 to 2-48CmGetDecompTable function2-45 to 2-46CmGetErrorInfo function2-48 to 2-52CmGetFullSizeImageAsync function2-60 to 2-61CmGetFullSizeImage function2-4, 2-57 to 2-60CmGetPictureInfo function2-4, 2-29 to 2-30CmGetPortInfo function2-3, 2-22 to 2-24CmGetProductInfo function2-37CmGetStdFeatures function2-35 to 2-36CmGetThumbnailImageAsync function2-56 to 2-57CmGetThumbnailImage function2-4, 2-54 to 2-56CmOpenDriver function2-3, 2-20CmPicture data type2-67CmPictureInfo data type2-18 to 2-19CmPortInfo data type2-10, 2-65CmPortInfo structure2-3CmProductInfo data type2-12, 2-66CmRestoreDefaults function2-38 to 2-39CmSelfTest function2-53CmSetDateAndTime function2-39 to 2-40CmSetFlashMode function2-42 to 2-43CmSetOwnerName function2-40 to 2-41CmSetPictureMode function2-41 to 2-42CmSetSleep function2-44 to 2-45CmStdFeatures data type2-10, 2-65CmTakePictureAsync function2-62 to 2-63CmTakePicture function2-4, 2-61 to 2-62color correction matrix2-47color correction tables4-17color difference image buffer4-3color processing tables4-15completion routine2-8application globals2-34compression table2-45determining4-18converting thumbnail images to RGB format4-10CRT chromaticity characteristics4-14Ddata transfer speed, determining2-26default compression table4-20determining the color correction matrix2-47device driver version number2-36device-independent bitmap3-3display characteristics4-8default values4-15determining4-13setting4-14display formats3-3DLLs (dynamic link libraries)2-2DLL version number2-36Eerasing images2-31erasing images asynchronously2-32erasing pictures1-6establishing a camera software connection2-3Ffile format, QuickTake 100 image file3-2flash mode2-43Ggamma characteristics4-14GeoPort protocolA-2getting camera compression table2-45getting camera information2-28getting camera status2-4getting color correction matrix2-47getting information about an image2-4getting product information2-37IImageAttribute data type4-3, 4-5, 4-21image capturing functions2-61 to 2-63image decompression, Windows platform4-2 to 4-4image processing, banded4-2Image Processing Module4-2 to 4-24calculating color tables4-9callback function4-12closing4-9converting images to RGB format4-12converting thumbnail images to RGB4-10determining display characteristics4-13functions4-7 to 4-20getting camera color correction matrix2-47getting current camera compression table2-45, 4-18initializing4-8opening4-8setting color matrix4-17setting default color matrix4-17setting default display characteristics4-15setting display characteristics4-14image resolutions3-2imagescolor depth3-3color format3-3converting to RGB format4-12default height2-38default size2-38default width2-38determining characteristics2-30erasing2-31memory size in bytes3-3retrieving2-58initializing default camera color matrix4-17initializing default compression table4-20initializing Image Processing Module4-8IpCalculateColorTables function4-9IpConvertADPCMtoRGB function4-11IpConvertThumbnailToRGB function4-10IpEndIPM function4-9IpGetCameraColorMatrix function4-16IpGetCompressionTable function4-18IpGetDisplayCharacteristics function4-13IpInitCameraColorMatrix function4-17IpInitCompressionTable function4-20IpInitDisplayCharacteristics function4-15IpInitIPM function4-8IPM data types4-4 to 4-7IpProgressProc callback function4-12IpSetCameraColorMatrix function4-17IpSetCompressionTable function4-19IpSetDisplayCharacteristics function4-14LLCD display indicatorsbattery power1-7pictures available1-7pictures taken1-7MMacintosh platform, QuickTake 100 software1-3Macintosh sample code for image retrieval2-5 to 2-7Pperforming asynchronous operations2-8PICT files5-2picture mode2-41picturesdisplaying on Macintosh platform5-2erasing2-31getting information2-30ProgressCallBack data type4-22ProgressCallBack IPM callback function4-7QQTAKE-D.INI file2-26QuickTake 100 camerafeatures1-4making a software connection2-3QuickTake 100 camera, defined1-2QuickTake 100 camera serial connectorA-2QuickTake 100 device driver2-2, 2-3QuickTake 100 file format, defined3-2QuickTake 100 QTAKE-D.INI file2-26QuickTake 100 QuickTime compressor1-2, 5-2QuickTime Image Compression Manager5-2Rrestoring default camera characteristics2-38retrieving device driver version number2-36retrieving images2-4, 2-58asynchronously2-60retrieving QuickTake 100 DLL version number2-36retrieving QuickTake 100 images2-5retrieving thumbnail images2-55, 2-56RotateAngle data type4-6, 4-22Ssample code2-5serial cablesA-3 to A-6serial communication, determining baud rate2-26serial data transfer rateMacintosh platformA-2setting, Windows2-26Windows platformA-2serial portA-2data formatsA-2making a connection2-26pin assignmentsA-2protocolsA-2transfer rateA-2setting camera color matrix4-17setting camera date and time2-39setting camera flash mode2-43setting camera owner name2-40setting camera picture mode2-41setting default display characteristics4-15setting display characteristics4-14setting image compression table4-19setting image resolution1-6setting sleep mode2-44sleep mode2-44Ttaking pictures1-6, 2-61 to 2-63asynchronously2-63with a timer1-6technical specificationsB-2thumbnail images1-2, 2-55, 2-56converting to RGB format4-10retrieving2-55retrieving asynchronously2-56Uuser features1-4 to 1-8Wcamera device driverfor Windows2-2Windows, setting the host data transfer rate2-26Windows platform, QuickTake 100 software1-4XXYChroma data type4-6, 4-22This Apple manual was written, edited, and composed on a desktop publishing system using Apple Macintosh computers and FrameMaker software. Line art was created using Adobe Illustrator™ and Adobe Photoshop™. Text type is Palatino® and display type is Helvetica®. Bullets are ITC Zapf Dingbats®. Some elements, such as program listings, are set in Apple Courier.WRITERSteve SchwanderDEVELOPMENTAL EDITORSLaurel Rezeau, Beverly ZegarskiILLUSTRATORSandee KarrPRODUCTION EDITORGerry GraySpecial thanks to Waymen Askey, Alex Crovetto, Paul Hangas, and Alex Pollayil≤ @ ˇ ˇˇˇˇ @
- ˇ·ˇ‚7^ , Palatino . +∫0